Bug 1283579 - Use data schema rather than outside document for test of bug 682592 to make it faster. r=jfkthame, a=test-only
authorXidorn Quan <me@upsuper.org>
Mon, 04 Jul 2016 13:16:08 +1000
changeset 395181 d7fb39af63f4890e51788fdacd9e1105a1ef3957
parent 395180 1a2331a741876542f14ad82f4c5264d70f98c832
child 395182 589e1f984537e280ff84591e94afdc3c5bfe2710
push id24716
push userbmo:jgilbert@mozilla.com
push dateMon, 01 Aug 2016 19:54:25 +0000
reviewersjfkthame, test-only
bugs1283579, 682592
milestone49.0a2
Bug 1283579 - Use data schema rather than outside document for test of bug 682592 to make it faster. r=jfkthame, a=test-only MozReview-Commit-ID: 6ccLpZF1qr8
dom/base/test/bug682592-subframe-ref.html
dom/base/test/bug682592-subframe.html
dom/base/test/mochitest.ini
dom/base/test/test_bug682592.html
deleted file mode 100644
--- a/dom/base/test/bug682592-subframe-ref.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
-    <title></title>
-</head>
-<body>
-<p id="content"></p>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/base/test/bug682592-subframe.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
-    <title></title>
-</head>
-<body>
-<p id="content"></p>
-</body>
-</html>
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -41,18 +41,16 @@ support-files =
   bug466409-empty.css
   bug466409-page.html
   bug475156.sjs
   bug482935.sjs
   bug540854.sjs
   bug578096LoadChromeScript.js
   bug638112-response.txt
   bug638112.sjs
-  bug682592-subframe-ref.html
-  bug682592-subframe.html
   bug696301-script-1.js
   bug696301-script-1.js^headers^
   bug696301-script-2.js
   bug704320.sjs
   bug704320_counter.sjs
   bug819051.sjs
   chrome/bug418986-1.js
   copypaste.js
--- a/dom/base/test/test_bug682592.html
+++ b/dom/base/test/test_bug682592.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     <title>Test for bug 682592</title>
     <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <p id="display"></p>
 <div id="content">
-<iframe id="iframe-ref" src="bug682592-subframe-ref.html"></iframe>
+<iframe id="iframe-ref"></iframe>
 <iframe id="iframe-test"></iframe>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript;version=1.7">
 /** Test for Bug 682592 **/
 
 /* 
    We want to check that bidi is detected correctly. So, we have a reference
@@ -34,39 +34,42 @@ https://bugzilla.mozilla.org/show_bug.cg
    So, instead of many diferent reftests, this mochitest implements a
    reftest-like. It creates reference text fragments in reference iframe, test
    text fragments in test iframe, and compare the documents. Then, it reloads
    test iframe. Reference iframe does not need to be reloaded between tests.
    It's ok (and maybe, desired) to keep bidi always enabled in that document. 
 */
 
 SimpleTest.waitForExplicitFinish();
-SimpleTest.requestLongerTimeout(2);
+SimpleTest.requestLongerTimeout(3);
 if (navigator.platform.startsWith("Linux arm")) { /* bugs 982875, 999429 */
   SimpleTest.expectAssertions(0, 4);
 }
 
+var page = `data:text/html;charset=UTF-8,<!DOCTYPE html>
+<html><body><p id="content"></p></body></html>`;
 var refFrame = document.getElementById("iframe-ref")
 var testFrame = document.getElementById("iframe-test");
 
 refFrame.addEventListener("load", function() {
   testFrame.addEventListener("load", function() {
     try {
       tests.next();
       ok(compareSnapshots(snapshotWindow(testFrame.contentWindow), 
                           snapshotWindow(refFrame.contentWindow), true)[0], 
          "bidi is not detected correctly");
 
       testFrame.contentWindow.location.reload();
     } catch (err if err instanceof StopIteration) {
       SimpleTest.finish();
     }
   }, false);
-  testFrame.src = "bug682592-subframe.html"
+  testFrame.src = page;
 }, false);
+refFrame.src = page;
 
 var rtl = "עִבְרִית";
 var non8bit =  "ʃ";
 var is8bit = "a";
 
 // concats aStr aNumber of times
 function strMult(aStr, aNumber) {
   if (aNumber === 0) {