Bug 1382815 - Convert more tests within js/xpconnect to comply with new data: URI inheritance model. r=smaug
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Fri, 21 Jul 2017 10:28:47 +0200
changeset 419032 d49314516d29da113548dfa060f88112525ed9c7
parent 419031 66a54d08470ecb0a8d1633d96b2ed87a6034c411
child 419033 00e1e1732521b5c28e3ace0562f2c7cb939f353e
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1382815
milestone56.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 1382815 - Convert more tests within js/xpconnect to comply with new data: URI inheritance model. r=smaug
js/xpconnect/tests/mochitest/file_bug605167.html
js/xpconnect/tests/mochitest/file_bug731471.html
js/xpconnect/tests/mochitest/mochitest.ini
js/xpconnect/tests/mochitest/test_bug605167.html
js/xpconnect/tests/mochitest/test_bug731471.html
js/xpconnect/tests/mochitest/test_bug829872.html
js/xpconnect/tests/mochitest/test_nukeContentWindow.html
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/tests/mochitest/file_bug605167.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<script>
+  parent.f = function() { return this; };
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/tests/mochitest/file_bug731471.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+1
+</body>
+</html>
--- a/js/xpconnect/tests/mochitest/mochitest.ini
+++ b/js/xpconnect/tests/mochitest/mochitest.ini
@@ -4,20 +4,22 @@ support-files =
   bug504877_helper.html
   bug571849_helper.html
   bug589028_helper.html
   bug92773_helper.html
   chrome_wrappers_helper.html
   file1_bug629227.html
   file2_bug629227.html
   file_bug505915.html
+  file_bug605167.html
   file_bug650273.html
   file_bug658560.html
   file_bug706301.html
   file_bug720619.html
+  file_bug731471.html
   file_bug738244.html
   file_bug760131.html
   file_bug781476.html
   file_bug789713.html
   file_bug795275.html
   file_bug795275.xml
   file_bug799348.html
   file_bug802557.html
--- a/js/xpconnect/tests/mochitest/test_bug605167.html
+++ b/js/xpconnect/tests/mochitest/test_bug605167.html
@@ -13,25 +13,25 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 505915 **/
-var dataUrl = "data:text/html,<script>parent.f = function() { return this; };<" + "/script>";
+var url = "file_bug605167.html";
 var targetUrl = "http://example.com";
 var f;
 
 var p = 0;
 function go() {
         switch (++p) {
         case 1:
-                frames[0].location = dataUrl;
+                frames[0].location = url;
                 break;
         case 2:
                 frames[0].location = targetUrl;
                 break;
         case 3:
                 try {
                     f().cross_origin_property;
                     ok(false, "should have thrown an exception");
--- a/js/xpconnect/tests/mochitest/test_bug731471.html
+++ b/js/xpconnect/tests/mochitest/test_bug731471.html
@@ -19,17 +19,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 731471. This is effectively a crashtest, but it uses window.open, which
     doesn't work in the crashtest harness. **/
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 function boom()
 {
-    w = window.open("data:text/html,1");
+    w = window.open("file_bug731471.html");
     setTimeout(function() {
         w.document.write("2");
         w.document.close();
         w.document.write("3 - Done");
         w.document.close();
         w.close();
         ok(true, "Didn't assert!");
         SimpleTest.finish();
--- a/js/xpconnect/tests/mochitest/test_bug829872.html
+++ b/js/xpconnect/tests/mochitest/test_bug829872.html
@@ -42,11 +42,11 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 </pre>
 <iframe id="ifr" onload="loaded();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
 <object id="obj" onload="loaded();" data="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></object>
-<iframe id="framesetholder" src="data:text/html,<html><head></head><frameset cols='100%'><frame id='fr' onload='parent.loaded();' src='http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html' /></frameset></html>"></iframe>
+<iframe id="framesetholder" srcdoc="<html><head></head><frameset cols='100%'><frame id='fr' onload='parent.loaded();' src='http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html' /></frameset></html>"></iframe>
 </body>
 </html>
--- a/js/xpconnect/tests/mochitest/test_nukeContentWindow.html
+++ b/js/xpconnect/tests/mochitest/test_nukeContentWindow.html
@@ -29,17 +29,17 @@ function waitForWindowDestroyed(winID, c
       SpecialPowers.executeSoon(callback);
     }
   };
   SpecialPowers.addObserver(observer, "outer-window-nuked");
 }
 
 add_task(async function() {
   let frame = $('subframe');
-  frame.src = "data:text/html,";
+  frame.srcdoc = "foo";
   await new Promise(resolve => frame.addEventListener("load", resolve, {once: true}));
 
   let win = frame.contentWindow;
   let winID = SpecialPowers.getDOMWindowUtils(win).outerWindowID;
 
   win.eval("obj = {}");
   win.obj.foo = {bar: "baz"};