Bug 686003 - The test for bug 507902 navigates away from the page while it's in progress; r=dougt
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 28 Dec 2011 17:52:35 -0500
changeset 84703 11c676ef0718d1364801598954aa1a52bc383dc0
parent 84702 f8d8caf0a60af6ff1ecb8eb0169a4e8de0dcde54
child 84704 c05d47054f2be57cfec5c812661f09d92b9e87e1
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs686003, 507902
milestone12.0a1
Bug 686003 - The test for bug 507902 navigates away from the page while it's in progress; r=dougt
dom/tests/mochitest/orientation/Makefile.in
dom/tests/mochitest/orientation/bug507902-frame.html
dom/tests/mochitest/orientation/test_bug507902.html
--- a/dom/tests/mochitest/orientation/Makefile.in
+++ b/dom/tests/mochitest/orientation/Makefile.in
@@ -40,14 +40,15 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= dom/tests/mochitest/orientation
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES	= \
+		bug507902-frame.html \
 		test_bug507902.html \
 		$(NULL)
 
 libs:: 	$(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
copy from dom/tests/mochitest/orientation/test_bug507902.html
copy to dom/tests/mochitest/orientation/bug507902-frame.html
--- a/dom/tests/mochitest/orientation/test_bug507902.html
+++ b/dom/tests/mochitest/orientation/bug507902-frame.html
@@ -1,38 +1,30 @@
 <!DOCTYPE HTML>
 <html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=507902
--->
 <head>
-  <title>Test for watchPosition </title>
+  <title>Frame for watchPosition </title>
   <script type="text/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=507902">Mozilla Bug 507902</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
+<script type="text/javascript">
+
+var ok = window.parent.ok;
+var SimpleTest = window.parent.SimpleTest;
 
 function boom()
 {
   window.addEventListener("unload", function(){}, false);
   window.addEventListener("devicemotion", function(){}, false);
   location = "data:text/html,2";
 
   ok(1, "leak will be at the end of mochitests. so pass.");
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener("load", function() { setTimeout(boom, 0); }, false);
 
 </script>
-</pre>
 </body>
 </html>
 
--- a/dom/tests/mochitest/orientation/test_bug507902.html
+++ b/dom/tests/mochitest/orientation/test_bug507902.html
@@ -1,38 +1,36 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=507902
 -->
 <head>
-  <title>Test for watchPosition </title>
+  <title>Test for devicemotion</title>
   <script type="text/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=507902">Mozilla Bug 507902</a>
 <p id="display"></p>
-<div id="content" style="display: none">
-  
+<div id="content">
+<iframe id="frame" src="bug507902-frame.html"></iframe>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function boom()
 {
   window.addEventListener("unload", function(){}, false);
   window.addEventListener("devicemotion", function(){}, false);
   location = "data:text/html,2";
 
   ok(1, "leak will be at the end of mochitests. so pass.");
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
-window.addEventListener("load", function() { setTimeout(boom, 0); }, false);
-
 </script>
 </pre>
 </body>
 </html>