Bug 1283579 - Use data schema rather than outside document for test of bug 682592 to make it faster. r=jfkthame
authorXidorn Quan <me@upsuper.org>
Mon, 04 Jul 2016 13:16:08 +1000
changeset 303684 045e13e67ed43f96e9639a9fec9f8e8b45fd91ed
parent 303683 ded9d3adbde1f182320fdb1302ce2e30a6c73764
child 303685 03ea4596d84203bf16fdf0d7fc003588c3e8a044
push id79141
push usercbook@mozilla.com
push dateTue, 05 Jul 2016 14:07:42 +0000
treeherdermozilla-inbound@f08c54971dd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1283579, 682592
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1283579 - Use data schema rather than outside document for test of bug 682592 to make it faster. r=jfkthame 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) {