Bug 990202 - Move the test page to a new window to prevent it from navigating the test runner frame back. r=bzbarsky, a=test-only
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 02 Apr 2014 08:53:04 -0400
changeset 217657 7be328110c45cea4a868d74d9ca4085e4252ccac
parent 217656 d75416f219162c09d0ef1a1d56bd0f44c7d33924
child 217658 cc734bdf4e414c6ba1c207919c8d8f042b512f5e
push id3
push usergszorc@mozilla.com
push dateWed, 29 Oct 2014 02:45:36 +0000
reviewersbzbarsky, test-only
bugs990202
milestone29.0
Bug 990202 - Move the test page to a new window to prevent it from navigating the test runner frame back. r=bzbarsky, a=test-only
docshell/test/file_framedhistoryframes.html
docshell/test/mochitest.ini
docshell/test/test_framedhistoryframes.html
testing/mochitest/b2g-debug.json
testing/mochitest/b2g-desktop.json
testing/mochitest/b2g.json
new file mode 100644
--- /dev/null
+++ b/docshell/test/file_framedhistoryframes.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<iframe id="iframe" src="historyframes.html"></iframe>
+<script type="application/javascript">
+
+var SimpleTest = window.opener.SimpleTest;
+var is = window.opener.is;
+
+function done() {
+  window.opener.done();
+}
+
+</script>
+</body>
+</html>
--- a/docshell/test/mochitest.ini
+++ b/docshell/test/mochitest.ini
@@ -74,10 +74,11 @@ support-files = file_bug668513.html
 [test_bug680257.html]
 [test_bug691547.html]
 [test_bug694612.html]
 [test_bug703855.html]
 [test_bug713825.html]
 [test_bug728939.html]
 [test_bug797909.html]
 [test_framedhistoryframes.html]
+support-files = file_framedhistoryframes.html
 [test_pushState_after_document_open.html]
 [test_windowedhistoryframes.html]
--- a/docshell/test/test_framedhistoryframes.html
+++ b/docshell/test/test_framedhistoryframes.html
@@ -7,25 +7,26 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 602256</title>
   <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=602256">Mozilla Bug 602256</a>
 <p id="display"></p>
 <div id="content">
-  <iframe id="iframe" src="historyframes.html"></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 602256 **/
 
 SimpleTest.waitForExplicitFinish();
+var win = window.open("file_framedhistoryframes.html");
 
 function done() {
+  win.close();
   SimpleTest.finish();
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/testing/mochitest/b2g-debug.json
+++ b/testing/mochitest/b2g-debug.json
@@ -258,16 +258,17 @@
     "docshell/test/navigation/test_bug13871.html":"",
     "docshell/test/navigation/test_bug270414.html":"",
     "docshell/test/navigation/test_bug344861.html":"",
     "docshell/test/navigation/test_bug386782.html":"",
     "docshell/test/navigation/test_not-opener.html":"",
     "docshell/test/navigation/test_reserved.html":"",
     "docshell/test/test_bug413310.html":"",
     "docshell/test/test_bug668513.html":"",
+    "docshell/test/test_framedhistoryframes.html":"",
 
     "dom/imptests/html/webgl":"",        
     "dom/battery/test/test_battery_basics.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_Alert.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_AppFramePermission.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_AppWindowNamespace.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_Auth.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_BrowserWindowNamespace.html":"",
--- a/testing/mochitest/b2g-desktop.json
+++ b/testing/mochitest/b2g-desktop.json
@@ -523,16 +523,17 @@
     "docshell/test/test_bug598895.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug637644.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug640387_1.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug660404.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug668513.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug669671.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug680257.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_bug728939.html": "Bug 931116, b2g desktop specific, initial triage",
+    "docshell/test/test_framedhistoryframes.html": "Bug 931116, b2g desktop specific, initial triage",
     "docshell/test/test_windowedhistoryframes.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/alarm/test/test_alarm_add_data.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/alarm/test/test_alarm_add_date.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/alarm/test/test_alarm_add_respectTimezone.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/alarm/test/test_alarm_remove.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/base/test/test_setting_opener.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/datastore/tests/test_oop.html": "Bug 931116, b2g desktop specific, initial triage",
     "dom/datastore/tests/test_readonly.html": "Bug 931116, b2g desktop specific, initial triage",
--- a/testing/mochitest/b2g.json
+++ b/testing/mochitest/b2g.json
@@ -221,16 +221,17 @@
     "content/base/test/test_mixed_content_blocker_bug803225.html":"",
     "content/html/document/test/test_non-ascii-cookie.html":"",
 
     "docshell/test/navigation/test_bug13871.html":"",
     "docshell/test/navigation/test_bug270414.html":"",
     "docshell/test/navigation/test_not-opener.html":"",
     "docshell/test/test_bug413310.html":"",
     "docshell/test/test_bug668513.html":"",
+    "docshell/test/test_framedhistoryframes.html":"",
 
     "dom/imptests/html/webgl":"",
 
     "dom/browser-element/mochitest/test_browserElement_inproc_Alert.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_AppFramePermission.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_AppWindowNamespace.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_Auth.html":"",
     "dom/browser-element/mochitest/test_browserElement_inproc_BrowserWindowNamespace.html":"",