Fix the test for bug 563416.
authorMats Palmgren <matspal@gmail.com>
Thu, 06 May 2010 17:37:39 +0200
changeset 41992 9f12b80e44905491d216a7dc8640da42cb1fa40f
parent 41991 dd9dc6d4bdb06341760d466aae45fc19b9bcd738
child 41993 8b75e3aab94cada0c67d737b4e24e274c4647eae
push idunknown
push userunknown
push dateunknown
bugs563416
milestone1.9.3a5pre
Fix the test for bug 563416.
layout/xul/test/Makefile.in
layout/xul/test/test_bug563416.html
--- a/layout/xul/test/Makefile.in
+++ b/layout/xul/test/Makefile.in
@@ -45,12 +45,13 @@ include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		test_bug372685.xul \
 		test_bug386386.html \
 		test_bug394800.xhtml \
 		test_bug398982-1.xul \
 		test_bug398982-2.xul \
+		test_bug563416.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
--- a/layout/xul/test/test_bug563416.html
+++ b/layout/xul/test/test_bug563416.html
@@ -6,51 +6,47 @@ https://bugzilla.mozilla.org/show_bug.cg
 <head>
   <title>Test for Bug 563416</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.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=563416">Mozilla Bug 563416</a>
-<p id="display"><iframe id="test" src='data:text/html,<textarea style="-moz-box-sizing:content-box; height: 0px;" cols="20" rows="10">hsldkjvmshlkkajskdlfksdjflskdjflskdjflskdjflskdjfddddddddd</textarea>'></iframe></p>
+<p id="display"><iframe id="test" src='data:text/html,<textarea style="-moz-box-sizing:content-box; -moz-appearance:none; height: 0px;" cols="20" rows="10">hsldkjvmshlkkajskdlfksdjflskdjflskdjflskdjflskdjfddddddddd</textarea>'></iframe></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 563416 **/
 
 var result = -1;
 var expected = -2;
 var i = 0;
 
-function continueTest() {
-  var frame = document.getElementById('test');
-  frame.contentWindow.location.reload();
-  if (i < 2)
-    setTimeout(continueTest,20)
-  else {
-    is(result, expected, "setting style.width changes clientWidth");
-    SimpleTest.finish();
-  }
-}
-
 function runTest() {
   i = 0;
   var frame = document.getElementById('test');
   frame.onload = function() {
     var t = frame.contentDocument.documentElement.getElementsByTagName("textarea")[0];
     expected = t.clientWidth + 10;
     t.style.width = expected + 'px';
     result = t.clientWidth;
-    i++;
+    if (i == 0) {
+      i++;
+      setTimeout(function(){frame.contentWindow.location.reload();},0);
+    }
+    else {
+      is(result, expected, "setting style.width changes clientWidth");
+      SimpleTest.finish();
+    }
   }
-  continueTest();
+  frame.contentWindow.location.reload();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runTest);
 
 
 </script>
 </pre>