Bug 1374460 - Remove mochitests using showModalDialog. r=smaug draft
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 08 Jun 2017 11:44:24 -0700
changeset 642183 f2596b40148a780cad4143c7989b6e67a2025025
parent 642173 fde1450a4368d04e97174e2eb00fb48901179857
child 642184 4245fb0a5a71596982eec0dd84bd6ad7074e9094
push id72678
push userbmo:mrbkap@mozilla.com
push dateMon, 07 Aug 2017 21:35:55 +0000
reviewerssmaug
bugs1374460
milestone57.0a1
Bug 1374460 - Remove mochitests using showModalDialog. r=smaug MozReview-Commit-ID: 5vLjdti5oW8
dom/base/test/mochitest.ini
dom/base/test/mutationobserver_dialog.html
dom/base/test/test_dialogArguments.html
dom/base/test/test_mutationobservers.html
dom/html/test/file_iframe_sandbox_c_if4.html
dom/html/test/file_iframe_sandbox_j_if1.html
dom/html/test/file_iframe_sandbox_j_if2.html
dom/html/test/file_iframe_sandbox_j_if3.html
dom/html/test/mochitest.ini
dom/html/test/test_bug391777.html
dom/html/test/test_iframe_sandbox_general.html
dom/html/test/test_iframe_sandbox_modal.html
dom/media/webspeech/recognition/test/test_nested_eventloop.html
dom/tests/mochitest/bugs/file1_bug437361.html
dom/tests/mochitest/bugs/file2_bug291653.html
dom/tests/mochitest/bugs/file2_bug437361.html
dom/tests/mochitest/bugs/file_bug291653.html
dom/tests/mochitest/bugs/file_bug504862.html
dom/tests/mochitest/bugs/mochitest.ini
dom/tests/mochitest/bugs/test_bug291653.html
dom/tests/mochitest/bugs/test_bug406375.html
dom/tests/mochitest/bugs/test_bug414291.html
dom/tests/mochitest/bugs/test_bug437361.html
dom/tests/mochitest/bugs/test_bug479143.html
dom/tests/mochitest/bugs/test_bug504862.html
dom/tests/mochitest/bugs/test_bug61098.html
dom/tests/mochitest/general/file_showModalDialog.html
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/general/test_showModalDialog.html
dom/tests/mochitest/general/test_showModalDialog_removed.html
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -184,17 +184,16 @@ support-files =
   file_xhtmlserializer_2_entw3c.xhtml
   file_xhtmlserializer_2_latin1.xhtml
   file_youtube_flash_embed.html
   forRemoval.resource
   forRemoval.resource^headers^
   formReset.html
   invalid_accesscontrol.resource
   invalid_accesscontrol.resource^headers^
-  mutationobserver_dialog.html
   orientationcommon.js
   plugin.js
   script-1_bug597345.sjs
   script-2_bug597345.js
   script_bug602838.sjs
   send_gzip_content.sjs
   somedatas.resource
   somedatas.resource^headers^
@@ -634,19 +633,16 @@ skip-if = toolkit == 'android' #bug 9041
 [test_copypaste.html]
 subsuite = clipboard
 skip-if = toolkit == 'android' #bug 904183
 [test_copypaste.xhtml]
 subsuite = clipboard
 skip-if = toolkit == 'android' #bug 904183
 [test_createHTMLDocument.html]
 [test_declare_stylesheet_obsolete.html]
-[test_dialogArguments.html]
-tags = openwindow
-skip-if = toolkit == 'android' || e10s # showmodaldialog
 [test_data_uri.html]
 [test_document.all_iteration.html]
 [test_document.all_unqualified.html]
 [test_document_constructor.html]
 [test_document_importNode_document.html]
 [test_document_register.html]
 [test_domcursor.html]
 [test_domparser_null_char.html]
deleted file mode 100644
--- a/dom/base/test/mutationobserver_dialog.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<html>
-  <head>
-    <title></title>
-    <script>
-
-    var div = document.createElement("div");
-
-    var M;
-    if ("MozMutationObserver" in window) {
-      M = window.MozMutationObserver;
-    } else if ("WebKitMutationObserver" in window) {
-      M = window.WebKitMutationObserver;
-    } else {
-      M = window.MutationObserver;
-    }
-
-    var didCall1 = false;
-    var didCall2 = false;
-    function testMutationObserverInDialog() {
-      div.innerHTML = "<span>1</span><span>2</span>";
-      m = new M(function(records, observer) {
-          opener.is(records[0].type, "childList", "Should have got childList");
-          opener.is(records[0].removedNodes.length, 2, "Should have got removedNodes");
-          opener.is(records[0].addedNodes.length, 1, "Should have got addedNodes");
-          observer.disconnect();
-          m = null;
-          didCall1 = true;
-        });
-      m.observe(div, { childList: true });
-      div.innerHTML = "<span><span>foo</span></span>";
-    }
-
-    function testMutationObserverInDialog2() {
-      div.innerHTML = "<span>1</span><span>2</span>";
-      m = new M(function(records, observer) {
-          opener.is(records[0].type, "childList", "Should have got childList");
-          opener.is(records[0].removedNodes.length, 2, "Should have got removedNodes");
-          opener.is(records[0].addedNodes.length, 1, "Should have got addedNodes");
-          observer.disconnect();
-          m = null;
-          didCall2 = true;
-        });
-      m.observe(div, { childList: true });
-      div.innerHTML = "<span><span>foo</span></span>";
-    }
-
-    window.addEventListener("load", testMutationObserverInDialog);
-    window.addEventListener("load", testMutationObserverInDialog2);
-    window.addEventListener("load",
-      function() {
-        opener.ok(didCall1, "Should have called 1st mutation callback");
-        opener.ok(didCall2, "Should have called 2nd mutation callback");
-        window.close();
-      });
-    </script>
-    <style>
-    </style>
-  </head>
-  <body>
-    <input type="button" onclick="window.close()" value="close">
-  </body>
-</html>
deleted file mode 100644
--- a/dom/base/test/test_dialogArguments.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<title>Test for Bug 1019761</title>
-	<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-	<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-	<meta http-equiv="content-type" content="text/html; charset=utf-8">
-</head>
-<body>
-<script type="application/javascript">
-
-/*
-	Tests whether Firefox crashes when accessing the dialogArguments property
-	of a modal window that has been closed.
-*/
-SimpleTest.waitForExplicitFinish();
-
-async function openModal() {
-	await SpecialPowers.pushPrefEnv({ set: [[
-		"dom.disable_window_showModalDialog", false ]] });
-
-	let iframe = document.createElement("iframe");
-	document.body.appendChild(iframe);
-	await new Promise(resolve => {
-		iframe.addEventListener("load", resolve);
-	});
-	iframe.contentWindow.showModalDialog("javascript:opener.winRef = window; \
-		window.opener.setTimeout(\'winRef.dialogArguments;\', 0);\
-		window.close();");
-
-	ok(true, "dialogArguments did not cause a crash.");
-	SimpleTest.finish();
-}
-
-window.onload = openModal;
-</script>
-</body>
-</html>
--- a/dom/base/test/test_mutationobservers.html
+++ b/dom/base/test/test_mutationobservers.html
@@ -479,45 +479,16 @@ function testSyncXHR() {
   x.open("GET", window.location, false);
   x.send();
   ok(!callbackHandled, "Shouldn't have called the mutation callback!");
   setTimeout(testSyncXHR2, 0);
 }
 
 function testSyncXHR2() {
   ok(callbackHandled, "Should have called the mutation callback!");
-  then(testModalDialog);
-}
-
-async function testModalDialog() {
-  await SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] });
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-  var didHandleCallback = false;
-  div.innerHTML = "<span>1</span><span>2</span>";
-  m = new M(function(records, observer) {
-      is(records[0].type, "childList", "Should have got childList");
-      is(records[0].removedNodes.length, 2, "Should have got removedNodes");
-      is(records[0].addedNodes.length, 1, "Should have got addedNodes");
-      observer.disconnect();
-      m = null;
-      didHandleCallback = true;
-    });
-  m.observe(div, { childList: true });
-  div.innerHTML = "<span><span>foo</span></span>";
-  try {
-    window.showModalDialog("mutationobserver_dialog.html");
-    ok(didHandleCallback, "Should have called the callback while showing modal dialog!");
-  } catch(e) {
-    todo(false, "showModalDialog not implemented on this platform");
-  }
   then(testTakeRecords);
 }
 
 function testTakeRecords() {
   var s = "<span>1</span><span>2</span>";
   div.innerHTML = s;
   var takenRecords;
   m = new M(function(records, observer) {
--- a/dom/html/test/file_iframe_sandbox_c_if4.html
+++ b/dom/html/test/file_iframe_sandbox_c_if4.html
@@ -7,38 +7,29 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <script type="text/javascript">
   function ok(result, desc) {
     window.parent.ok_wrapper(result, desc);
   }
 
   function doStuff() {
-    // try to open a new window via target="_blank", target="BC341604", window.open(), and showModalDialog()
+    // try to open a new window via target="_blank", target="BC341604", and window.open()
     // the window we try to open closes itself once it opens
     sendMouseEvent({type:'click'}, 'target_blank');
     sendMouseEvent({type:'click'}, 'target_BC341604');
 
     var threw = false;
     try {
       window.open("about:blank");
     } catch (error) {
       threw = true;
     }
 
     ok(threw, "window.open threw a JS exception and was not allowed");
-
-    threw = false;
-    try {
-      window.showModalDialog("about:blank");
-    } catch(error) {
-      threw = true;
-    }
-
-    ok(threw, "window.showModalDialog threw a JS exception and was not allowed");
   }
 </script>
 <body onLoad="doStuff()">
   I am sandboxed but with "allow-scripts allow-same-origin"
 
   <a href="file_iframe_sandbox_open_window_fail.html" target="_blank" id="target_blank">open window</a>
   <a href="file_iframe_sandbox_open_window_fail.html" target="BC341604" id="target_BC341604">open window</a>
 </body>
deleted file mode 100644
--- a/dom/html/test/file_iframe_sandbox_j_if1.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 766282</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<script type="text/javascript">
-  function doStuff() {
-    // Open a new window via showModalDialog().
-    try {
-      window.showModalDialog("file_iframe_sandbox_k_if5.html");
-    } catch(e) {
-      window.parent.ok_wrapper(false, "iframes sandboxed with allow-popups and allow-modals should be able to open a modal dialog");
-    }
-
-    // Open a new window via showModalDialog().
-    try {
-      window.showModalDialog("file_iframe_sandbox_k_if7.html");
-    } catch(e) {
-      window.parent.ok_wrapper(false, "iframes sandboxed with allow-popups and allow-modals should be able to open a modal dialog");
-    }
-  }
-</script>
-
-<body onLoad="doStuff()">
-  I am sandboxed with "allow-scripts allow-popups allow-same-origin allow-forms allow-top-navigation".
-</body>
-</html>
deleted file mode 100644
--- a/dom/html/test/file_iframe_sandbox_j_if2.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 766282</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<script type="text/javascript">
-  function doSubOpens() {
-    // Open a new window showModalDialog().
-    try {
-      window.showModalDialog("file_iframe_sandbox_k_if9.html");
-    } catch(e) {
-      window.parent.ok_wrapper(false, "iframes sandboxed with allow-popups and allow-modals should be able to open a modal dialog");
-    }
-  }
-
-  window.doSubOpens = doSubOpens;
-</script>
-
-<body>
-  I am sandboxed but with "allow-scripts allow-popups allow-same-origin".
-  After my initial load, "allow-same-origin" is removed and then I open file_iframe_sandbox_k_if9.html,
-  which attemps to call a function in my parent.
-  This should succeed since the new sandbox flags shouldn't have taken affect on me until I'm reloaded.
-</body>
-</html>
deleted file mode 100644
--- a/dom/html/test/file_iframe_sandbox_j_if3.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Tests for Bug 766282</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-</head>
-<script type="text/javascript">
-  function ok(result, desc) {
-    window.parent.ok_wrapper(result, desc);
-  }
-
-  function doStuff() {
-    // Try to open a new window via showModalDialog().
-    // The window we try to open closes itself once it opens.
-    try {
-      window.showModalDialog("file_iframe_sandbox_open_window_pass.html");
-    } catch(e) {
-      ok(false, "iframes sandboxed with allow-popups and allow-modals should be able to open a modal dialog");
-    }
-  }
-</script>
-<body onLoad="doStuff()">
-  I am sandboxed but with "allow-popups allow-scripts allow-same-origin"
-</body>
-</html>
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -128,19 +128,16 @@ support-files =
   file_iframe_sandbox_f_if1.html
   file_iframe_sandbox_f_if2.html
   file_iframe_sandbox_f_if2.html^headers^
   file_iframe_sandbox_fail.js
   file_iframe_sandbox_form_fail.html
   file_iframe_sandbox_form_pass.html
   file_iframe_sandbox_g_if1.html
   file_iframe_sandbox_h_if1.html
-  file_iframe_sandbox_j_if1.html
-  file_iframe_sandbox_j_if2.html
-  file_iframe_sandbox_j_if3.html
   file_iframe_sandbox_k_if1.html
   file_iframe_sandbox_k_if2.html
   file_iframe_sandbox_k_if3.html
   file_iframe_sandbox_k_if4.html
   file_iframe_sandbox_k_if5.html
   file_iframe_sandbox_k_if6.html
   file_iframe_sandbox_k_if7.html
   file_iframe_sandbox_k_if8.html
@@ -472,19 +469,16 @@ tags = fullscreen
 skip-if = toolkit == 'android' # just copy the conditions from the test above
 [test_hidden.html]
 [test_html_attributes_reflection.html]
 [test_htmlcollection.html]
 [test_iframe_sandbox_general.html]
 tags = openwindow
 [test_iframe_sandbox_inheritance.html]
 tags = openwindow
-[test_iframe_sandbox_modal.html]
-tags = openwindow
-skip-if = toolkit == 'android' || e10s #modal tests fail on android
 [test_iframe_sandbox_navigation.html]
 tags = openwindow
 [test_iframe_sandbox_navigation2.html]
 tags = openwindow
 [test_iframe_sandbox_plugins.html]
 skip-if = toolkit == 'android' # plugins not supported
 [test_iframe_sandbox_popups.html]
 tags = openwindow
@@ -536,18 +530,16 @@ skip-if = toolkit == 'android' #bug 8116
 [test_bug311681.xhtml]
 [test_bug324378.html]
 [test_bug332848.xhtml]
 [test_bug340017.xhtml]
 [test_bug359657.html]
 [test_bug369370.html]
 skip-if = toolkit == "android" || toolkit == "windows" # disabled on Windows because of bug 1234520
 [test_bug380383.html]
-[test_bug391777.html]
-skip-if = toolkit == 'android' || e10s
 [test_bug402680.html]
 [test_bug403868.html]
 [test_bug403868.xhtml]
 [test_bug435128.html]
 skip-if = true # Disabled for timeouts.
 [test_bug463104.html]
 [test_form-parsing.html]
 [test_viewport.html]
deleted file mode 100644
--- a/dom/html/test/test_bug391777.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=391777
--->
-<head>
-  <title>Test for Bug 391777</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=391777">Mozilla Bug 391777</a>
-<p id="display"></p>
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 391777 **/
-SimpleTest.waitForExplicitFinish();
-
-SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, doTest);
-async function doTest() {
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-  var arg = {};
-  arg.testVal = "foo";
-  var result = window.showModalDialog("javascript:window.returnValue = window.dialogArguments.testVal; window.close(); 'This window should close on its own.';", arg);
-  ok(true, "We should get here without user interaction");
-  is(result, "foo", "Unexpected result from showModalDialog");
-  SimpleTest.finish();
-}
-
-</script>
-</body>
-</html>
--- a/dom/html/test/test_iframe_sandbox_general.html
+++ b/dom/html/test/test_iframe_sandbox_general.html
@@ -36,17 +36,17 @@ function ok_wrapper(result, desc) {
   ok(result, desc);
 
   completedTests++;
 
   if (result) {
     passedTests++;
   }
 
-  if (completedTests == 33) {
+  if (completedTests == 32) {
     is(passedTests, completedTests, "There are " + completedTests + " general tests that should pass");
     SimpleTest.finish();
   }
 }
 
 function doTest() {
   // passes twice if good
   // 1) test that inline scripts (<script>) can run in an iframe sandboxed with "allow-scripts"
deleted file mode 100644
--- a/dom/html/test/test_iframe_sandbox_modal.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=766282
-implement allow-popups directive for iframe sandbox
--->
-<head>
-  <meta charset="utf-8">
-  <title>Tests for Bug 766282</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<script>
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-
-// A postMessage handler that is used by sandboxed iframes without
-// 'allow-same-origin' to communicate pass/fail back to this main page.
-window.addEventListener("message", receiveMessage);
-
-function receiveMessage(event) {
-  switch (event.data.type) {
-    case "attempted":
-      testAttempted();
-      break;
-    case "ok":
-      ok_wrapper(event.data.ok, event.data.desc, event.data.addToAttempted);
-      break;
-    default:
-      // allow for old style message
-      if (event.data.ok != undefined) {
-        ok_wrapper(event.data.ok, event.data.desc, event.data.addToAttempted);
-      }
-  }
-}
-
-var attemptedTests = 0;
-var passedTests = 0;
-var totalTestsToPass = 5;
-var totalTestsToAttempt = 5;
-
-function ok_wrapper(result, desc, addToAttempted = true) {
-  ok(result, desc);
-
-  if (result) {
-    passedTests++;
-  }
-
-  if (addToAttempted) {
-    testAttempted();
-  }
-}
-
-// Added so that tests that don't register unless they fail,
-// can at least notify that they've attempted to run.
-function testAttempted() {
-  attemptedTests++;
-  if (attemptedTests == totalTestsToAttempt) {
-    // Make sure all tests have had a chance to complete.
-    setTimeout(function() {finish();}, 1000);
-  }
-}
-
-var finishCalled = false;
-
-function finish() {
-  if (!finishCalled) {
-    finishCalled = true;
-    is(passedTests, totalTestsToPass, "There are " + totalTestsToPass + " modal tests that should pass");
-
-    SimpleTest.finish();
-  }
-}
-
-function doTest() {
-  // passes if good and fails if bad
-  // 1) A window opened from inside an iframe that has sandbox = "allow-scripts allow-popups
-  // allow-same-origin" should not have its origin sandbox flag set and be able to access
-  // document.cookie. (Done by file_iframe_sandbox_k_if5.html opened from
-  // file_iframe_sandbox_j_if1.html) using showModalDialog.)
-
-  // passes if good
-  // 2) A window opened from inside an iframe that has sandbox = "allow-scripts allow-popups
-  // allow-top-navigation" should not have its top-level navigation sandbox flag set and be able to
-  // navigate top. (Done by file_iframe_sandbox_k_if5.html (and if6) opened from
-  // file_iframe_sandbox_j_if1.html) using showModalDialog.)
-
-  // passes if good
-  // 3) A window opened from inside an iframe that has sandbox = "allow-scripts allow-popups
-  // all-forms" should not have its forms sandbox flag set and be able to submit forms.
-  // (Done by file_iframe_sandbox_k_if7.html opened from
-  // file_iframe_sandbox_j_if1.html) using showModalDialog.)
-
-  // passes if good
-  // 4) Make sure that the sandbox flags copied to a new browsing context are taken from the
-  // current active document not the browsing context (iframe / docShell).
-  // This is done by removing allow-same-origin and calling doSubOpens from file_iframe_sandbox_j_if2.html,
-  // which opens file_iframe_sandbox_k_if9.html using showModalDialog.
-  var if_2 = document.getElementById('if_2');
-  if_2.sandbox = 'allow-scripts allow-popups';
-  if_2.contentWindow.doSubOpens();
-
-  // passes if good
-  // 5) Test that a sandboxed iframe with "allow-popups" can open a new window using window.ShowModalDialog.
-  // This is done via file_iframe_sandbox_j_if3.html which is sandboxed with "allow-popups allow-scripts
-  // allow-same-origin". The window it attempts to open calls window.opener.ok(true, ...) and
-  // file_iframe_j_if3.html has an ok() function that calls window.parent.ok_wrapper.
-}
-
-let loaded = new Promise(resolve => { addLoadEvent(resolve) });
-let prefSet = SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] });
-Promise.all([ loaded, prefSet ]).then(doTest);
-</script>
-
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=766282">Mozilla Bug 766282</a> - implement allow-popups directive for iframe sandbox
-<p id="display"></p>
-<div id="content">
-<iframe sandbox="allow-scripts allow-popups allow-modals allow-same-origin allow-forms allow-top-navigation" id="if_1" src="file_iframe_sandbox_j_if1.html" height="10" width="10"></iframe>
-<iframe sandbox="allow-scripts allow-popups allow-modals allow-same-origin" id="if_2" src="file_iframe_sandbox_j_if2.html" height="10" width="10"></iframe>
-<iframe sandbox="allow-popups allow-modals allow-same-origin allow-scripts" id="if_3" src="file_iframe_sandbox_j_if3.html" height="10" width="10"></iframe>
-</div>
--- a/dom/media/webspeech/recognition/test/test_nested_eventloop.html
+++ b/dom/media/webspeech/recognition/test/test_nested_eventloop.html
@@ -16,29 +16,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script type="text/javascript">
   SimpleTest.waitForExplicitFinish();
 
   /*
-   * window.showModalDialog() can be used to spin the event loop, causing
+   * SpecialPowers.spinEventLoop can be used to spin the event loop, causing
    * queued SpeechEvents (such as those created by calls to start(), stop()
    * or abort()) to be processed immediately.
    * When this is done from inside DOM event handlers, it is possible to
    * cause reentrancy in our C++ code, which we should be able to withstand.
    */
   function abortAndSpinEventLoop(evt, sr) {
     sr.abort();
     SpecialPowers.spinEventLoop(window);
   }
   function doneFunc() {
     // Trigger gc now and wait some time to make sure this test gets the blame
-    // for any assertions caused by showModalDialog
+    // for any assertions caused by spinning the event loop.
     //
     // NB - The assertions should be gone, but this looks too scary to touch
     // during batch cleanup.
     var count = 0, GC_COUNT = 4;
 
     function triggerGCOrFinish() {
       SpecialPowers.gc();
       count++;
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/file1_bug437361.html
+++ /dev/null
@@ -1,1 +0,0 @@
-<html><body onload='close(); returnValue = 1;' /></html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/file2_bug291653.html
+++ /dev/null
@@ -1,1 +0,0 @@
-<script>var maintest = opener.opener; opener.location = 'data:text/html,test'; maintest.end(); window.close();</script>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/file2_bug437361.html
+++ /dev/null
@@ -1,1 +0,0 @@
-<html><body onload='close(); returnValue = 1;' /></html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/file_bug291653.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-  <head>
-    <script>
-    <!--
-    function listener1() {
-      window.showModalDialog("file2_bug291653.html");
-    }
-
-    function listener2() {
-      opener.secondListenerDidRun = true;
-    }
-    
-    window.addEventListener("foo", listener1);
-    window.addEventListener("foo", listener2);
-    
-    
-    function fireFoo() {
-      var e = document.createEvent("Events");
-      e.initEvent("foo", true, true);
-      window.dispatchEvent(e);
-    }
-    //-->
-    </script>
-  </head>
-  <body onload="setTimeout(fireFoo, 0)">
-  Test for bug 291653
-  </body>
-</html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/file_bug504862.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<body>
-<script>
-window.returnValue = 3;
-
-if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
-  // Test that we got the right arguments.
-  opener.is(window.dialogArguments, "my args",
-            "dialog did not get the right arguments.");
-
-  // Load a different url, and test that it sees the arguments (since it's same origin).
-  window.location="file2_bug504862.html";
-} else {
-  // Post a message containing our arguments to the opener to test
-  // that this cross origing dialog does *not* see the passed in
-  // arguments.
-  opener.postMessage("args: " + window.dialogArguments,
-                     "http://mochi.test:8888");
-
-  close();
-}
-</script>
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -5,20 +5,16 @@ support-files =
   bug346659-opener-echoer.html
   bug346659-opener.html
   bug346659-parent-echoer.html
   bug346659-parent.html
   bug458091_child.html
   child_bug260264.html
   devicemotion_inner.html
   devicemotion_outer.html
-  file_bug291653.html
-  file2_bug291653.html
-  file_bug406375.html
-  file_bug504862.html
   file2_bug504862.html
   file_bug593174_1.html
   file_bug593174_2.html
   file_bug809290_b1.html
   file_bug809290_b2.html
   file_bug809290_c.html
   file_empty.html
   file_window_bar.html
@@ -40,31 +36,26 @@ support-files =
   file_redirector.sjs
   file_prime_cookie.html
   test1_bug369306.html
   test2_bug369306.html
   test1_bug622361.html
   test2_bug622361.html
   file1_bug414291.html
   file2_bug414291.html
-  file3_bug414291.html
-  file1_bug437361.html
-  file2_bug437361.html
 
 [test_DOMWindowCreated_chromeonly.html]
 [test_bug132255.html]
 [test_bug159849.html]
 [test_bug289714.html]
 [test_bug260264.html]
 skip-if = toolkit == 'android'
 [test_bug260264_nested.html]
 [test_bug265203.html]
 [test_bug291377.html]
-[test_bug291653.html]
-skip-if = e10s || toolkit == 'android' #TIMED_OUT
 [test_bug304459.html]
 [test_bug308856.html]
 [test_bug327891.html]
 [test_bug333983.html]
 [test_bug335976.xhtml]
 [test_bug342448.html]
 [test_bug345521.html]
 [test_bug346659.html]
@@ -76,40 +67,31 @@ skip-if = toolkit == 'android' #TIMED_OU
 [test_bug384122.html]
 [test_bug389366.html]
 [test_bug38959.html]
 [test_bug393974.html]
 [test_bug394769.html]
 [test_bug396843.html]
 [test_bug400204.html]
 [test_bug404748.html]
-[test_bug406375.html]
-skip-if = e10s || toolkit == 'android'
 [test_bug414291.html]
-skip-if = toolkit == 'android' # TODO Remove me in bug 1374460
 tags = openwindow
 [test_bug427744.html]
 skip-if = toolkit == 'android'
 [test_bug42976.html]
 [test_bug430276.html]
-[test_bug437361.html]
-skip-if = e10s || toolkit == 'android'
 [test_bug440572.html]
 [test_bug456151.html]
 [test_bug458091.html]
 [test_bug459848.html]
 [test_bug465263.html]
-[test_bug479143.html]
-skip-if = e10s || toolkit == 'android'
 [test_bug484775.html]
 [test_bug492925.html]
 [test_bug49312.html]
 [test_bug495219.html]
-[test_bug504862.html]
-skip-if = e10s || toolkit == 'android' #RANDOM
 [test_bug529328.html]
 [test_bug531176.html]
 [test_bug531542.html]
 [test_bug534149.html]
 [test_bug541530.html]
 [test_bug545314.html]
 [test_bug548828.html]
 [test_bug558973.html]
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug291653.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=291653
--->
-<head>
-  <title>Test for Bug 291653</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=291653">Mozilla Bug 291653</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 291653 **/
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-
-var secondListenerDidRun = false;
-
-var w;
-function start() {
-  w = window.open("file_bug291653.html", "foo", "width=300,height=300");
-}
-
-function closeTest() {
-  w.close();
-  setTimeout("finish()", 500);
-}
-
-function finish() {
-  ok(!secondListenerDidRun, "Shouldn't have run second listener!");
-  SimpleTest.finish();
-}
-
-function end() {
-  setTimeout("closeTest()", 500);
-}
-
-SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, start);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug406375.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=406375
--->
-<head>
-  <title>Test for Bug 406375</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body onload="runTest()">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=406375">Mozilla Bug 406375</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 406375 **/
-
-
-SimpleTest.waitForExplicitFinish();
-
-async function runTest() {
-  await SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] });
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-  window.showModalDialog("file_bug406375.html");
-  ok(true, "This test should not hang");
-
-  SimpleTest.finish();
-}
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/tests/mochitest/bugs/test_bug414291.html
+++ b/dom/tests/mochitest/bugs/test_bug414291.html
@@ -8,40 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <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=414291">Mozilla Bug 414291</a>
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 414291 **/
-SimpleTest.waitForExplicitFinish();
-
 var result1 = 0;
 var result2 = 0;
-var result3 = 0;
 
 window.open("file1_bug414291.html", "w1");
 is(result1, 0, "window should not be opened either as modal or loaded synchronously.");
 
 window.open("file2_bug414291.html", "w2", "modal=yes");
 is(result2, 0, "window should not be opened either as modal or data loaded synchronously.");
 
-SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, runModalTest);
-async function runModalTest() {
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-  if (window.showModalDialog) {
-    result3 = window.showModalDialog("file3_bug414291.html");
-    is(result3, 3, "window should be opened as modal.");
-  }
-  SimpleTest.finish();
-}
-
 </script>
 </pre>
 </body>
 </html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug437361.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=437361
--->
-<head>
-  <title>Test for Bug 437361</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-  
-  <script class="testbody" type="text/javascript">
-
-  /** Test for Bug 437361 **/
-
-  function testModalDialogBlockedCleanly() {
-    is(true, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
-    var rv = window.showModalDialog( // should be blocked without exception
-      "file1_bug437361.html");
-    is(rv, null, "Modal dialog opened unexpectedly.");
-  }
-  
-  function testModalDialogAllowed() {
-    is(false, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
-    var rv = window.showModalDialog( // should not be blocked this time
-      "file2_bug437361.html");
-    is(rv, 1, "Problem with modal dialog returnValue.");
-  }
-
-  function testOtherExceptionsNotTrapped() {
-    is(false, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
-    window.showModalDialog('about:config'); // forbidden by SecurityCheckURL
-  }
-
-  function test(disableOpen, exceptionExpected, testFn, errorMsg) {
-    var oldPrefVal = SpecialPowers.getBoolPref("dom.disable_open_during_load");
-    try {
-      SpecialPowers.setBoolPref("dom.disable_open_during_load", disableOpen);
-      testFn();
-      ok(!exceptionExpected, errorMsg);
-    } catch (_) {
-      ok(exceptionExpected, errorMsg);
-    }
-    finally {
-      SpecialPowers.setBoolPref("dom.disable_open_during_load", oldPrefVal);
-    }
-  }
-
-  SimpleTest.waitForExplicitFinish();
-
-  SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, doTest);
-  async function doTest() {
-    let iframe = document.createElement("iframe");
-    document.body.appendChild(iframe);
-    await new Promise(resolve => {
-      iframe.addEventListener("load", resolve);
-    });
-    window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-    test(true, false, testModalDialogBlockedCleanly,
-         "Blocked showModalDialog caused an exception.");
-
-    test(false, false, testModalDialogAllowed,
-         "showModalDialog was blocked even though dom.disable_open_during_load was false.");
-
-    test(false, true, testOtherExceptionsNotTrapped,
-         "Incorrectly suppressed insecure showModalDialog exception.");
-
-    SimpleTest.finish();
-  }
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437361">Mozilla Bug 437361</a>
-<p id="display"></p>
-<div id="content" style="display: none"> 
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug479143.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=479143
--->
-<head>
-  <title>Test for Bug 411103</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=479143">Mozilla Bug 479143</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-  SimpleTest.waitForExplicitFinish();
-
-  SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, doTest);
-  async function doTest() {
-    await SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] });
-    let iframe = document.createElement("iframe");
-    document.body.appendChild(iframe);
-    await new Promise(resolve => {
-      iframe.addEventListener("load", resolve);
-    });
-    window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-    var interval = setInterval(function() { var i = 0; i++; }, 10);
-
-    var xhr = new XMLHttpRequest();
-    xhr.open("GET", "test_bug479143.html", false);
-    xhr.send(null);
-
-    window.showModalDialog("javascript:" +
-                           "setTimeout(function() { window.close(); }, 1000);",
-                           null);
-
-    clearInterval(interval);
-
-    ok(true, "did not crash");
-
-    SimpleTest.finish();
-  }
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug504862.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=504862
--->
-<head>
-  <title>Test for Bug 504862</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="runTest()">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=504862">Mozilla Bug 504862</a>
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 504862 **/
-SimpleTest.waitForExplicitFinish();
-function onMsgRcv(event)
-{
-  is(event.data, "args: undefined", "Unexpected cross origin dialog arguments.");
-}
-
-async function runTest() {
-  await SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] });
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-  window.addEventListener("message", onMsgRcv);
-
-  var result = window.showModalDialog("file_bug504862.html", "my args");
-  // NB: We used to clear returnValue on each navigation, but now we do a
-  // security check on access, so we can safely make returnValue live on
-  // the browsing context, per spec.
-  is(result, 3, "window sees previous dialog documents return value.");
-
-  result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
-
-  is(result, undefined, "Able to see return value from cross origin dialog.");
-
-  SimpleTest.finish();
-}
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/tests/mochitest/bugs/test_bug61098.html
+++ b/dom/tests/mochitest/bugs/test_bug61098.html
@@ -301,45 +301,16 @@ async function runtestsInner()
   } catch(e) {
     is(e.name, "NS_ERROR_NOT_AVAILABLE", "Wrong exception");
   }
 
   is (promptState, void(0), "Wrong prompt state after blocked prompt()");
 
   w.close();
 
-  let iframe = document.createElement("iframe");
-  document.body.appendChild(iframe);
-  await new Promise(resolve => {
-    iframe.addEventListener("load", resolve);
-  });
-  window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-  // Test that showModalDialog() works normally and then gets blocked
-  // on the second call.
-  if (window.showModalDialog) {
-    w = window.open();
-    w.showModalDialog("data:text/html,%3Cscript>window.close();%3C/script>")
-    is (promptState, void(0), "Wrong prompt state");
-
-    try {
-      w.showModalDialog("data:text/html,%3Cscript>window.close();%3C/script>")
-      ok(false, "showModalDialog call should throw an exception");
-    } catch(e) {
-      is(e.name, "NS_ERROR_NOT_AVAILABLE", "Wrong exception");
-    }
-    is (promptState.method, "confirm", "Wrong prompt method called");
-    is (promptState.parent, w, "Wrong confirm parent");
-    is (promptState.msg, "Prevent this page from creating additional dialogs",
-        "Wrong confirm message");
-    promptState = void(0);
-
-    w.close();
-  }
-
   mockPromptFactoryRegisterer.unregister();
   mockPromptServiceRegisterer.unregister();
 
   SimpleTest.finish();
 }
 
 </script>
 </body>
deleted file mode 100644
--- a/dom/tests/mochitest/general/file_showModalDialog.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-  function go() {
-    is(SpecialPowers.wrap(window).location.toString(), location.toString(), "sanity");
-    ok("returnValue" in window && "dialogArguments" in window, "We are modal");
-    var iwin = document.getElementById('ifr').contentWindow;
-    is(SpecialPowers.Cu.getClassName(iwin, /* aUnwrap = */ true), "Window", "Descendant frames should not be modal");
-
-    if (location.origin != "http://mochi.test:8888") {
-      is(window.dialogArguments, undefined,
-        "dialogArguments should be undefined cross-origin: " + location.origin);
-    }
-
-    window.returnValue = "rv: " + window.dialogArguments;
-
-    // Allow for testing navigations in series.
-    if (location.search == "") {
-      window.close();
-    } else {
-      var origins = location.search.split('?')[1].split(',');
-      var newsearch = '?' + origins.splice(1).join(',');
-      var newurl = location.toString().replace(location.origin, origins[0])
-                                      .replace(location.search, newsearch);
-      location = newurl;
-    }
-
-  }
-</script>
-</head>
-<body onload="opener.postMessage('dosetup', '*');">
-<iframe id="ifr"></iframe>
-</body>
-</html>
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -4,17 +4,16 @@ support-files =
   fail.png
   file_bug628069.html
   file_clonewrapper.html
   file_domWindowUtils_scrollbarSize.html
   file_frameElementWrapping.html
   file_interfaces.xml
   file_moving_nodeList.html
   file_moving_xhr.html
-  file_showModalDialog.html
   historyframes.html
   start_historyframe.html
   url1_historyframe.html
   url2_historyframe.html
   image_50.png
   image_100.png
   image_200.png
   pass.apng
@@ -117,18 +116,16 @@ support-files = test_offsets.js
 [test_picture_mutations.html]
 [test_pointerPreserves3D.html]
 [test_pointerPreserves3DClip.html]
 [test_resource_timing.html]
 [test_resource_timing_cross_origin.html]
 [test_resource_timing_frameset.html]
 [test_selectevents.html]
 skip-if = toolkit == 'android' # bug 1230232 - Mouse doesn't select in the same way
-[test_showModalDialog.html]
-skip-if = e10s || toolkit == 'android' #Don't run modal tests on Android
 [test_showModalDialog_removed.html]
 [test_storagePermissionsAccept.html]
 [test_storagePermissionsLimitForeign.html]
 [test_storagePermissionsReject.html]
 [test_storagePermissionsRejectForeign.html]
 [test_stylesheetPI.html]
 [test_vibrator.html]
 [test_WebKitCSSMatrix.html]
deleted file mode 100644
--- a/dom/tests/mochitest/general/test_showModalDialog.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=862918
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 862918</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-
-  /** Test for window.showModalDialog. **/
-
-  // The modal window needs to touch Cu, which means that it needs
-  // SpecialPowers. But given the semantics of modal windows, we have to
-  // do some funny stuff with postMessage to set this up.
-  window.onmessage = function(evt) {
-    is(evt.data, 'dosetup', "message from modal window is correct");
-    var win = SpecialPowers.wrap(evt.source);
-    win.wrappedJSObject.SpecialPowers = SpecialPowers;
-    SpecialPowers.setWrapped(win.wrappedJSObject, 'is', SpecialPowers.wrap(is));
-    SpecialPowers.setWrapped(win.wrappedJSObject, 'ok', SpecialPowers.wrap(ok));
-    win.wrappedJSObject.go();
-  };
-
-  SimpleTest.waitForExplicitFinish();
-
-  SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, doTest);
-  async function doTest() {
-    let iframe = document.createElement("iframe");
-    document.body.appendChild(iframe);
-    await new Promise(resolve => {
-      iframe.addEventListener("load", resolve);
-    });
-    window.showModalDialog = iframe.contentWindow.showModalDialog;
-
-    var someObj = { foo: 42, bar: "hi"};
-    var xurl = location.toString()
-                       .replace('mochi.test:8888', 'example.org')
-                       .replace('test_showModal', 'file_showModal');
-    if (xurl.indexOf('?') != -1)
-      xurl = xurl.substring(0, xurl.indexOf('?'));
-    is(window.showModalDialog('file_showModalDialog.html'), "rv: undefined");
-    is(window.showModalDialog(xurl), undefined);
-    is(window.showModalDialog('file_showModalDialog.html', 3), "rv: 3");
-    is(window.showModalDialog(xurl, 3), undefined);
-    is(window.showModalDialog('file_showModalDialog.html', someObj), "rv: " + someObj);
-    is(window.showModalDialog(xurl, someObj), undefined);
-
-    // Test sequential navigations.
-    is(window.showModalDialog('file_showModalDialog.html?http://mochi.test:8888', 4),
-                       'rv: 4');
-    is(window.showModalDialog('file_showModalDialog.html?http://example.com', 4), undefined);
-    is(window.showModalDialog('file_showModalDialog.html?http://example.com,http://mochi.test:8888', 4), 'rv: 4');
-
-    // This test used to assert after gc. Make sure it doesn't.
-    SpecialPowers.gc();
-    SimpleTest.finish();
-  }
-
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=862918">Mozilla Bug 862918</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
--- a/dom/tests/mochitest/general/test_showModalDialog_removed.html
+++ b/dom/tests/mochitest/general/test_showModalDialog_removed.html
@@ -15,18 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content">
   <iframe id="frame" style="height:100px; width:100px; border:0"></iframe>
   <div id="status" style="display: none"></div>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
-/** Test for showModalDialog unavailability in Firefox **/
+/** Test for showModalDialog unavailability in Firefox. **/
 
-// NB: This test runs in e10s only. In e10s showModalDialog should not
-// exist.
+// showModalDialog was removed in bug 981796.
 ok(!window.showModalDialog, "showModalDialog should not exist");
 
 </script>
 </pre>
 </body>
 </html>