Bug 1304290 - Part 1: Add a helper function to run test in a new window. r=smaug
authorStone Shih <sshih@mozilla.com>
Wed, 21 Sep 2016 14:46:44 +0800
changeset 317863 b9ab8fa47b68f769c5f2813710fb04276eca9b0b
parent 317862 e813ac799ffea42936de59caf1991eb99d514990
child 317864 0e44d66f5e61c429f4c4e649882b39916808e0e2
push id30819
push usercbook@mozilla.com
push dateFri, 14 Oct 2016 09:59:32 +0000
treeherdermozilla-central@1391a2889aeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1304290
milestone52.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 1304290 - Part 1: Add a helper function to run test in a new window. r=smaug MozReview-Commit-ID: 4nLTUSbkYlH
dom/events/test/pointerevents/mochitest_support_external.js
dom/events/test/pointerevents/mochitest_support_internal.js
dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html
dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html
dom/events/test/pointerevents/test_pointerevent_attributes_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_capture_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_change-touch-action-onpointerdown_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_constructor.html
dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
dom/events/test/pointerevents/test_pointerevent_element_haspointercapture_release_pending_capture-manual.html
dom/events/test/pointerevents/test_pointerevent_gotpointercapture_before_first_pointerevent-manual.html
dom/events/test/pointerevents/test_pointerevent_lostpointercapture_for_disconnected_node-manual.html
dom/events/test/pointerevents/test_pointerevent_lostpointercapture_is_first-manual.html
dom/events/test/pointerevents/test_pointerevent_multiple_primary_pointers_boundary_events-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerId_scope-manual.html
dom/events/test/pointerevents/test_pointerevent_pointercancel_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerdown-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerenter-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerenter_does_not_bubble-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerenter_nohover-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointercancel_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointerup_nohover-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_descendant_over-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_descendants-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_does_not_bubble-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_pen-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerleave_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_pointermove-manual.html
dom/events/test/pointerevents/test_pointerevent_pointermove-on-chorded-mouse-button.html
dom/events/test/pointerevents/test_pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html
dom/events/test/pointerevents/test_pointerevent_pointermove_pointertype-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerout-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointercancel_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointerup_nohover-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerout_pen-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerout_received_once-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerover-manual.html
dom/events/test/pointerevents/test_pointerevent_pointertype_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_pointertype_pen-manual.html
dom/events/test/pointerevents/test_pointerevent_pointertype_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerup-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html
dom/events/test/pointerevents/test_pointerevent_pointerup_pointertype-manual.html
dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html
dom/events/test/pointerevents/test_pointerevent_releasepointercapture_invalid_pointerid-manual.html
dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointercancel_touch-manual.html
dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointerup_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_releasepointercapture_release_right_after_capture-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_disconnected-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_inactive_button_mouse-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_invalid_pointerid-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_override_pending_capture_element-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html
dom/events/test/pointerevents/test_pointerevent_setpointercapture_to_same_element_twice-manual.html
dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_click.html
dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_drag_mouse.html
--- a/dom/events/test/pointerevents/mochitest_support_external.js
+++ b/dom/events/test/pointerevents/mochitest_support_external.js
@@ -30,32 +30,16 @@ function turnOnPointerEvents(callback) {
   SpecialPowers.pushPrefEnv({
     "set": [
       ["dom.w3c_pointer_events.enabled", true],
       ["layout.css.touch_action.enabled", true]
     ]
   }, callback);
 }
 
-// Function checks that test should have status PASS
-function result_function(testObj) {
-if(testObj["status"] != testObj["PASS"])
-  console.log(testObj["status"] + " = " + testObj["PASS"] + ". " + testObj["name"]);
-  is(testObj["status"], testObj["PASS"], testObj["name"]);
-}
-
-// Function allows to correct finish test in mochitest system
-function completion_function() {
-  console.log("w3c tests have been finished");
-  if(!SimpleTest._stopOnLoad) {
-    console.log("Finishing Mochitest system");
-    SimpleTest.finish();
-  }
-}
-
 // Helper function to send MouseEvent with different parameters
 function sendMouseEvent(int_win, elemId, mouseEventType, params) {
   var elem = int_win.document.getElementById(elemId);
   if(!!elem) {
     var rect = elem.getBoundingClientRect();
     var eventObj = {type: mouseEventType};
     if(params && "button" in params)
       eventObj.button = params.button;
@@ -77,8 +61,50 @@ function sendTouchEvent(int_win, elemId,
     var rect = elem.getBoundingClientRect();
     var eventObj = {type: touchEventType};
     console.log(elemId, eventObj);
     synthesizeTouch(elem, rect.width/4, rect.height/2, eventObj, int_win);
   } else {
     is(!!elem, true, "Document should have element with id: " + elemId);
   }
 }
+
+// Helper function to run Point Event test in a new tab.
+function runTestInNewWindow(aFile) {
+  var w = window.open('', "_blank");
+  w.is = function(a, b, msg) { return is(a, b, aFile + " | " + msg); };
+  w.ok = function(cond, name, diag) { return ok(cond, aFile + " | " + name, diag); };
+  w.location = location.href.substring(0, location.href.lastIndexOf('/') + 1) + aFile;
+
+  w.testContext = {
+    result_callback: (aTestObj) => {
+      if(aTestObj["status"] != aTestObj["PASS"]) {
+        console.log(aTestObj["status"] + " = " + aTestObj["PASS"] + ". " + aTestObj["name"]);
+      }
+      is(aTestObj["status"], aTestObj["PASS"], aTestObj["name"]);
+    },
+
+    completion_callback: () => {
+      if (!!w.testContext.executionPromise) {
+        // We need to wait tests done and execute finished then we can close the window
+        w.testContext.executionPromise.then(() => {
+          w.close();
+          SimpleTest.finish();
+        });        
+      } else {
+        // execute may synchronous trigger tests done. In that case executionPromise
+        // is not yet assigned 
+        w.close();
+        SimpleTest.finish();
+      }
+    },
+
+    execute: (aWindow) => {
+      turnOnPointerEvents(() => {
+        w.testContext.executionPromise = new Promise((aResolve, aReject) => {
+          executeTest(aWindow);
+          aResolve();
+        });
+      });
+    }
+  };
+  return w;
+}
--- a/dom/events/test/pointerevents/mochitest_support_internal.js
+++ b/dom/events/test/pointerevents/mochitest_support_internal.js
@@ -8,28 +8,19 @@ addEventListener("load", function(event)
   addListeners(document.getElementById("target0"));
   addListeners(document.getElementById("target1"));
   preExecute();
 }, false);
 
 // Function allows to initialize prerequisites before testing
 // and adds some callbacks to support mochitest system.
 function preExecute() {
-  add_result_callback(parent.result_function);
-  add_completion_callback(parent.completion_function);
-  parent.turnOnPointerEvents(window.callExecute);
-}
-
-// The main function allows to execute tests in auto mode
-function callExecute() {
-  console.log("Run 'executeTest' function");
-  if(!!parent.executeTest)
-    parent.executeTest(window);
-  else
-    parent.is(!!parent.executeTest, true, "parent-document should have function 'executeTest'");
+  add_result_callback(testContext.result_callback);
+  add_completion_callback(testContext.completion_callback);
+  testContext.execute(window);
 }
 
 function addListeners(elem) {
   if(!elem)
     return;
   var All_Events = ["pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout",
                     "pointerenter","pointerleave","gotpointercapture","lostpointercapture"];
   All_Events.forEach(function(name) {
--- a/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html
+++ b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_1.html
@@ -8,25 +8,23 @@
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
         setImplicitPointerCapture(true, loadSubFrame);
       }
       function loadSubFrame() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "bug1293174_implicit_pointer_capture_for_touch_1.html";
+        runTestInNewWindow("bug1293174_implicit_pointer_capture_for_touch_1.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target1", "touchmove");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
 
--- a/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html
+++ b/dom/events/test/pointerevents/test_bug1293174_implicit_pointer_capture_for_touch_2.html
@@ -8,25 +8,23 @@
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
         setImplicitPointerCapture(false, loadSubFrame);
       }
       function loadSubFrame() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "bug1293174_implicit_pointer_capture_for_touch_2.html";
+        runTestInNewWindow("bug1293174_implicit_pointer_capture_for_touch_2.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target1", "touchmove");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
 
--- a/dom/events/test/pointerevents/test_pointerevent_attributes_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_attributes_mouse-manual.html
@@ -9,29 +9,27 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_attributes_mouse-manual.html";
+        runTestInNewWindow("pointerevent_attributes_mouse-manual.html");
       }
       function executeTest(int_win) {
         var square1 = int_win.document.getElementById("square1");
         var rect = square1.getBoundingClientRect();
         var x = rect.left + rect.width / 4;
         var y = rect.top + rect.height / 2
         synthesizeMouseAtPoint(x, y, {type: "mousemove", button:-1}, int_win);
         synthesizeMouseAtPoint(x, y, {type: "mousedown", button:0},  int_win);
         synthesizeMouseAtPoint(x, y, {type: "mouseup",   button:0},  int_win);
         synthesizeMouseAtPoint(x, y, {type: "mousemove", button:-1}, int_win);
         synthesizeMouseAtPoint(rect.left-1, rect.top-1, {type: "mousemove", button:-1}, int_win);
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
 
--- a/dom/events/test/pointerevents/test_pointerevent_capture_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_capture_mouse-manual.html
@@ -9,26 +9,24 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_capture_mouse-manual.html";
+        runTestInNewWindow("pointerevent_capture_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "btnCapture", "mousemove");
         sendMouseEvent(int_win, "target0",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "btnCapture", "mousedown", {button:1});
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mouseup");
         sendMouseEvent(int_win, "target1",    "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html
@@ -9,27 +9,25 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_capture_suppressing_mouse-manual.html";
+        runTestInNewWindow("pointerevent_capture_suppressing_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "btnCapture", "mousedown", {button:1});
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "target0",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mouseup");
         sendMouseEvent(int_win, "target1",    "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_change-touch-action-onpointerdown_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_change-touch-action-onpointerdown_touch-manual.html
@@ -9,18 +9,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_change-touch-action-onpointerdown_touch-manual.html";
+        runTestInNewWindow("pointerevent_change-touch-action-onpointerdown_touch-manual.html");
       }
       function executeTest(int_win) {
         const WM_VSCROLL = 0x0115;
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target0", "touchend");
         //sendTouchEvent(int_win, "target0", "touchstart");
         //sendTouchEvent(int_win, "target0", "touchmove");
@@ -29,11 +28,10 @@ https://bugzilla.mozilla.org/show_bug.cg
         var target0 = int_win.document.getElementById("target0");
         utils.sendNativeMouseScrollEvent(target0.getBoundingClientRect().left + 5,
                                         target0.getBoundingClientRect().top + 5,
                                         WM_VSCROLL, 10, 10, 0, 0, 0, target0);
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_constructor.html
+++ b/dom/events/test/pointerevents/test_pointerevent_constructor.html
@@ -9,20 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_constructor.html";
+        runTestInNewWindow("pointerevent_constructor.html");
       }
       function executeTest(int_win) {
         // Function should be, but can be empty
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
@@ -9,26 +9,24 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_element_haspointercapture-manual.html";
+        runTestInNewWindow("pointerevent_element_haspointercapture-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target1", "mousemove", {button:0});
         sendMouseEvent(int_win, "target1", "mouseup", {button:0});
         sendMouseEvent(int_win, "target1", "mousedown", {button:0});
         sendMouseEvent(int_win, "target1", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture_release_pending_capture-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture_release_pending_capture-manual.html
@@ -9,24 +9,22 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_element_haspointercapture_release_pending_capture-manual.html";
+        runTestInNewWindow("pointerevent_element_haspointercapture_release_pending_capture-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target1", "mousemove", {button:0});
         sendMouseEvent(int_win, "target1", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_gotpointercapture_before_first_pointerevent-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_gotpointercapture_before_first_pointerevent-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_gotpointercapture_before_first_pointerevent-manual.html";
+        runTestInNewWindow("pointerevent_gotpointercapture_before_first_pointerevent-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup",   {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_lostpointercapture_for_disconnected_node-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_lostpointercapture_for_disconnected_node-manual.html
@@ -10,24 +10,22 @@ https://bugzilla.mozilla.org/show_bug.cg
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       SimpleTest.requestFlakyTimeout("Official test uses timeout");
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_lostpointercapture_for_disconnected_node-manual.html";
+        runTestInNewWindow("pointerevent_lostpointercapture_for_disconnected_node-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "btnCapture", "mousedown");
         sendMouseEvent(int_win, "btnCapture", "mousemove");
         setTimeout(function() {
           sendMouseEvent(int_win, "target1", "mousemove");
         }, 500);
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_lostpointercapture_is_first-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_lostpointercapture_is_first-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_lostpointercapture_is_first-manual.html";
+        runTestInNewWindow("pointerevent_lostpointercapture_is_first-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "btnCapture", "mousedown", {button:0});
         sendMouseEvent(int_win, "btnCapture", "mouseup", {button:0});
         sendMouseEvent(int_win, "btnCapture", "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_multiple_primary_pointers_boundary_events-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_multiple_primary_pointers_boundary_events-manual.html
@@ -9,25 +9,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_multiple_primary_pointers_boundary_events-manual.html";
+        runTestInNewWindow("pointerevent_multiple_primary_pointers_boundary_events-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendTouchEvent(int_win, "target1", "touchstart");
         sendTouchEvent(int_win, "target1", "touchend");
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "done",    "mousedown", {button:0});
         sendMouseEvent(int_win, "done",    "mouseup",   {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerId_scope-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerId_scope-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerId_scope-manual.html";
+        runTestInNewWindow("pointerevent_pointerId_scope-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointercancel_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointercancel_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointercancel_touch-manual.html";
+        runTestInNewWindow("pointerevent_pointercancel_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchcancel");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerdown-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerdown-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerdown-manual.html";
+        runTestInNewWindow("pointerevent_pointerdown-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "log",     "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:1});
         sendMouseEvent(int_win, "target0", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerenter-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerenter-manual.html
@@ -9,20 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerenter-manual.html";
+        runTestInNewWindow("pointerevent_pointerenter-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerenter_does_not_bubble-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerenter_does_not_bubble-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerenter_does_not_bubble-manual.html";
+        runTestInNewWindow("pointerevent_pointerenter_does_not_bubble-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "log",     "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerenter_nohover-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerenter_nohover-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerenter_nohover-manual.html";
+        runTestInNewWindow("pointerevent_pointerenter_nohover-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "log",     "mousemove");
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointercancel_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointercancel_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_after_pointercancel_touch-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_after_pointercancel_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchcancel");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointerup_nohover-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_after_pointerup_nohover-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_after_pointerup_nohover-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_after_pointerup_nohover-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_descendant_over-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_descendant_over-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_descendant_over-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_descendant_over-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target1", "mousedown");
         sendMouseEvent(int_win, "target1", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_descendants-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_descendants-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_descendants-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_descendants-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "log",     "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_does_not_bubble-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_does_not_bubble-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_does_not_bubble-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_does_not_bubble-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_mouse-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_mouse-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "log",     "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_pen-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_pen-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_pen-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_pen-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown",   {inputSource:MouseEvent.MOZ_SOURCE_PEN});
         sendMouseEvent(int_win, "target0", "mouseup",     {inputSource:MouseEvent.MOZ_SOURCE_PEN});
         sendMouseEvent(int_win, "target0", "mousecancel", {inputSource:MouseEvent.MOZ_SOURCE_PEN});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerleave_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerleave_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerleave_touch-manual.html";
+        runTestInNewWindow("pointerevent_pointerleave_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointermove-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointermove-manual.html
@@ -9,20 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointermove-manual.html";
+        runTestInNewWindow("pointerevent_pointermove-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointermove-on-chorded-mouse-button.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointermove-on-chorded-mouse-button.html
@@ -9,18 +9,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointermove-on-chorded-mouse-button.html";
+        runTestInNewWindow("pointerevent_pointermove-on-chorded-mouse-button.html");
       }
 
       function executeTest(int_win) {
         var utils = _getDOMWindowUtils(int_win);
         sendMouseEvent(int_win, "target0", "mousemove", {button:0, buttons:utils.MOUSE_BUTTONS_NO_BUTTON});
         sendMouseEvent(int_win, "target0", "mousedown", {button:0, buttons:utils.MOUSE_BUTTONS_LEFT_BUTTON});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0, buttons:utils.MOUSE_BUTTONS_LEFT_BUTTON});
         sendMouseEvent(int_win, "target0", "mousedown", {button:1, buttons:utils.MOUSE_BUTTONS_LEFT_BUTTON |
@@ -29,11 +28,10 @@ https://bugzilla.mozilla.org/show_bug.cg
                                                                            utils.MOUSE_BUTTONS_MIDDLE_BUTTON});
         sendMouseEvent(int_win, "target0", "mouseup", {button:1, buttons:utils.MOUSE_BUTTONS_LEFT_BUTTON});
         sendMouseEvent(int_win, "target0", "mousemove", {button:1, buttons:utils.MOUSE_BUTTONS_LEFT_BUTTON});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0, buttons:utils.MOUSE_BUTTONS_NO_BUTTON});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html";
+        runTestInNewWindow("pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointermove_pointertype-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointermove_pointertype-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointermove_pointertype-manual.html";
+        runTestInNewWindow("pointerevent_pointermove_pointertype-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
         sendMouseEvent(int_win, "target0", "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerout-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerout-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerout-manual.html";
+        runTestInNewWindow("pointerevent_pointerout-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointercancel_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointercancel_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerout_after_pointercancel_touch-manual.html";
+        runTestInNewWindow("pointerevent_pointerout_after_pointercancel_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchcancel");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointerup_nohover-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerout_after_pointerup_nohover-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerout_after_pointerup_nohover-manual.html";
+        runTestInNewWindow("pointerevent_pointerout_after_pointerup_nohover-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerout_pen-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerout_pen-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerout_pen-manual.html";
+        runTestInNewWindow("pointerevent_pointerout_pen-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown",   {inputSource:MouseEvent.MOZ_SOURCE_PEN});
         sendMouseEvent(int_win, "target0", "mouseup",     {inputSource:MouseEvent.MOZ_SOURCE_PEN});
         sendMouseEvent(int_win, "target0", "mousecancel", {inputSource:MouseEvent.MOZ_SOURCE_PEN});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerout_received_once-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerout_received_once-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerout_received_once-manual.html";
+        runTestInNewWindow("pointerevent_pointerout_received_once-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerover-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerover-manual.html
@@ -9,20 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerover-manual.html";
+        runTestInNewWindow("pointerevent_pointerover-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointertype_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointertype_mouse-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointertype_mouse-manual.html";
+        runTestInNewWindow("pointerevent_pointertype_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointertype_pen-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointertype_pen-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointertype_pen-manual.html";
+        runTestInNewWindow("pointerevent_pointertype_pen-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {inputSource:MouseEvent.MOZ_SOURCE_PEN});
         sendMouseEvent(int_win, "target0", "mouseup",   {inputSource:MouseEvent.MOZ_SOURCE_PEN});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointertype_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointertype_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointertype_touch-manual.html";
+        runTestInNewWindow("pointerevent_pointertype_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerup-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerup-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerup-manual.html";
+        runTestInNewWindow("pointerevent_pointerup-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
         sendMouseEvent(int_win, "target0", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html";
+        runTestInNewWindow("pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_pointerup_pointertype-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_pointerup_pointertype-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_pointerup_pointertype-manual.html";
+        runTestInNewWindow("pointerevent_pointerup_pointertype-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
         sendMouseEvent(int_win, "target0", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_releasepointercapture_events_to_original_target-manual.html";
+        runTestInNewWindow("pointerevent_releasepointercapture_events_to_original_target-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchmove");
         sendTouchEvent(int_win, "target0", "touchend");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_invalid_pointerid-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_invalid_pointerid-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_releasepointercapture_invalid_pointerid-manual.html";
+        runTestInNewWindow("pointerevent_releasepointercapture_invalid_pointerid-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchmove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointercancel_touch-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointercancel_touch-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_releasepointercapture_onpointercancel_touch-manual.html";
+        runTestInNewWindow("pointerevent_releasepointercapture_onpointercancel_touch-manual.html");
       }
       function executeTest(int_win) {
         sendTouchEvent(int_win, "target0", "touchstart");
         sendTouchEvent(int_win, "target0", "touchcancel");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointerup_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_onpointerup_mouse-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_releasepointercapture_onpointerup_mouse-manual.html";
+        runTestInNewWindow("pointerevent_releasepointercapture_onpointerup_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "btnCapture", "mousedown");
         sendMouseEvent(int_win, "btnCapture", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_release_right_after_capture-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_release_right_after_capture-manual.html
@@ -8,25 +8,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     <title>Test for Bug 1000870</title>
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_releasepointercapture_release_right_after_capture-manual.html";
+        runTestInNewWindow("pointerevent_releasepointercapture_release_right_after_capture-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_disconnected-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_disconnected-manual.html
@@ -9,21 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_disconnected-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_disconnected-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
         sendMouseEvent(int_win, "target0", "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_inactive_button_mouse-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_inactive_button_mouse-manual.html
@@ -9,22 +9,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_inactive_button_mouse-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_inactive_button_mouse-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target1", "mousemove");
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target1", "mousemove");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_invalid_pointerid-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_invalid_pointerid-manual.html
@@ -9,20 +9,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_invalid_pointerid-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_invalid_pointerid-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_override_pending_capture_element-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_override_pending_capture_element-manual.html
@@ -9,25 +9,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_override_pending_capture_element-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_override_pending_capture_element-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html
@@ -9,23 +9,21 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_relatedtarget-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_relatedtarget-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "btnCapture", "mousedown");
         sendMouseEvent(int_win, "target1",    "mousemove");
         sendMouseEvent(int_win, "target1",    "mouseup");
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_to_same_element_twice-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_to_same_element_twice-manual.html
@@ -9,25 +9,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_setpointercapture_to_same_element_twice-manual.html";
+        runTestInNewWindow("pointerevent_setpointercapture_to_same_element_twice-manual.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup", {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_click.html
+++ b/dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_click.html
@@ -9,25 +9,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_suppress_compat_events_on_click.html";
+        runTestInNewWindow("pointerevent_suppress_compat_events_on_click.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup",   {button:0});
         sendMouseEvent(int_win, "target1", "mousedown", {button:0});
         sendMouseEvent(int_win, "target1", "mouseup",   {button:0});
         sendMouseEvent(int_win, "done",    "mousedown", {button:0});
         sendMouseEvent(int_win, "done",    "mouseup",   {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_drag_mouse.html
+++ b/dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_drag_mouse.html
@@ -9,27 +9,25 @@ https://bugzilla.mozilla.org/show_bug.cg
     <meta name="author" content="Maksim Lebedev" />
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script type="text/javascript" src="mochitest_support_external.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     <script type="text/javascript">
       SimpleTest.waitForExplicitFinish();
       function startTest() {
-        var iframe = document.getElementById("testFrame");
-        iframe.src = "pointerevent_suppress_compat_events_on_drag_mouse.html";
+        runTestInNewWindow("pointerevent_suppress_compat_events_on_drag_mouse.html");
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         sendMouseEvent(int_win, "target0", "mousemove", {button:0});
         sendMouseEvent(int_win, "target0", "mouseup",   {button:0});
         sendMouseEvent(int_win, "target1", "mousedown", {button:0});
         sendMouseEvent(int_win, "target1", "mousemove", {button:0});
         sendMouseEvent(int_win, "target1", "mouseup",   {button:0});
         sendMouseEvent(int_win, "done",    "mousedown", {button:0});
         sendMouseEvent(int_win, "done",    "mouseup",   {button:0});
       }
     </script>
   </head>
   <body>
-    <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>