Bug 687297 - Added Mochitest to verify that the per-presentation base minimum font size is propagated without being influenced by the language-specific global preference. r=dbaron
☠☠ backed out by 996a81d8d116 ☠ ☠
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Wed, 26 Feb 2014 23:00:13 -0800
changeset 171255 1d16baf1f90a1e6b07d03c40c0c2864426277cac
parent 171254 27f21343ffe5c253a66082d6ee923784ec95961c
child 171256 b0e36a2e2ee5bb7a4b50dafcc3838992cb95f350
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersdbaron
bugs687297
milestone30.0a1
Bug 687297 - Added Mochitest to verify that the per-presentation base minimum font size is propagated without being influenced by the language-specific global preference. r=dbaron This test applies a large value to the font.minimum-size.ja preference, opens a new window, advances the url through an iso-8859-1 page, a Shift-JIS page, and back to an iso-8859-1 page. If the height of a div containing text on the first iso-8859-1 page and last iso-8859-1 page do not match, then the test is failed.
layout/base/tests/bug687297_a.html
layout/base/tests/bug687297_b.html
layout/base/tests/bug687297_c.html
layout/base/tests/mochitest.ini
layout/base/tests/test_bug687297.html
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug687297_a.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+  <title>Test companion for Bug 687297</title>
+  <style type="text/css"> * { font-size:9px; } </style>
+</head>
+<body>
+  <div id="test_content">ABCDEFG 0123456</div>
+</body>
+<script type="application/javascript">
+  window.onload = function() {
+    opener.report_size_a(document.getElementById("test_content").clientHeight);
+    window.location.href = "bug687297_b.html";
+  };
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug687297_b.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+  <title>Test companion for Bug 687297</title>
+  <style type="text/css"> * { font-size:9px; } </style>
+</head>
+<body>
+  <div id="test_content">ABCDEFG 0123456</div>
+</body>
+<script type="application/javascript">
+  window.onload = function() {
+    opener.report_size_b(document.getElementById("test_content").clientHeight);
+    window.location.href = "bug687297_c.html";
+  };
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug687297_c.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+  <title>Test companion for Bug 687297</title>
+  <style type="text/css"> * { font-size:9px; } </style>
+</head>
+<body>
+  <div id="test_content">ABCDEFG 0123456</div>
+</body>
+<script type="application/javascript">
+  window.onload = function() {
+    opener.report_size_c(document.getElementById("test_content").clientHeight);
+    window.close();
+  };
+</script>
+</html>
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -448,8 +448,13 @@ skip-if = toolkit == "win"
 [test_bug570378-persian-5g.html]
 skip-if = toolkit == "win"
 [test_bug749186.html]
 skip-if = toolkit == "win"
 [test_bug644768.html]
 skip-if = toolkit == "win"
 [test_flush_on_paint.html]
 skip-if = true || (toolkit == 'android') || (toolkit == "cocoa") # Bug 688128, bug 539356
+[test_bug687297.html]
+support-files =
+  bug687297_a.html
+  bug687297_b.html
+  bug687297_c.html
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/test_bug687297.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=687297
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 687297</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SpecialPowers.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=687297">Mozilla Bug 687297</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+  <script class="testbody" type="text/javascript">
+    /** Test for Bug 687297 **/
+    
+    SimpleTest.waitForExplicitFinish();
+  
+    var size_a=0, size_b=0, size_c=0;
+    
+    window.report_size_a = function(s) {
+      size_a = s;
+    };
+  
+    window.report_size_b = function(s) {
+      size_b = s;
+    };
+  
+    window.report_size_c = function(s) {
+      size_c = s;
+      
+      isnot(size_a, size_b, "Font sizes are changing with global language-specific minimum font size");
+      is(size_c, size_a, "Font sizes are equal, propagating only the presentation-level base minimum font size");
+
+      SimpleTest.finish();
+    };
+  
+    SpecialPowers.pushPrefEnv(
+      {'set':[["font.minimum-size.ja", 120]]},
+      function() {
+        window.open("bug687297_a.html", '_blank');
+      }
+    );
+  
+  </script>
+</pre>
+</body>
+</html>