summaryrefslogtreecommitdiffstats
path: root/dom/tests
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests')
-rw-r--r--dom/tests/mochitest/bugs/file_bug291653.html28
-rw-r--r--dom/tests/mochitest/bugs/file_bug504862.html22
-rw-r--r--dom/tests/mochitest/bugs/mochitest.ini12
-rw-r--r--dom/tests/mochitest/bugs/test_bug291653.html56
-rw-r--r--dom/tests/mochitest/bugs/test_bug406375.html37
-rw-r--r--dom/tests/mochitest/bugs/test_bug414291.html6
-rw-r--r--dom/tests/mochitest/bugs/test_bug437361.html72
-rw-r--r--dom/tests/mochitest/bugs/test_bug479143.html44
-rw-r--r--dom/tests/mochitest/bugs/test_bug504862.html45
-rw-r--r--dom/tests/mochitest/bugs/test_bug61098.html22
-rw-r--r--dom/tests/mochitest/bugs/test_bug735237.html38
-rw-r--r--dom/tests/mochitest/general/file_showModalDialog.html35
-rwxr-xr-xdom/tests/mochitest/general/mochitest.ini3
-rw-r--r--dom/tests/mochitest/general/test_showModalDialog.html60
14 files changed, 0 insertions, 480 deletions
diff --git a/dom/tests/mochitest/bugs/file_bug291653.html b/dom/tests/mochitest/bugs/file_bug291653.html
deleted file mode 100644
index 4bfc8337e..000000000
--- a/dom/tests/mochitest/bugs/file_bug291653.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
- <head>
- <script>
- <!--
- function listener1() {
- window.showModalDialog("data:text/html,<script>var maintest = opener.opener; opener.location = 'data:text/html,test'; maintest.end(); window.close();</script>");
- }
-
- 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>
diff --git a/dom/tests/mochitest/bugs/file_bug504862.html b/dom/tests/mochitest/bugs/file_bug504862.html
deleted file mode 100644
index dc11ced6f..000000000
--- 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="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';";
-} 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>
diff --git a/dom/tests/mochitest/bugs/mochitest.ini b/dom/tests/mochitest/bugs/mochitest.ini
index 309aab6e0..3743c6782 100644
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -10,9 +10,6 @@ support-files =
child_bug260264.html
devicemotion_inner.html
devicemotion_outer.html
- file_bug291653.html
- file_bug406375.html
- file_bug504862.html
file_bug593174_1.html
file_bug593174_2.html
file_bug809290_b1.html
@@ -45,7 +42,6 @@ skip-if = toolkit == 'android'
[test_bug260264_nested.html]
[test_bug265203.html]
[test_bug291377.html]
-[test_bug291653.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug304459.html]
[test_bug308856.html]
@@ -67,28 +63,21 @@ skip-if = toolkit == 'android' #TIMED_OUT
[test_bug396843.html]
[test_bug400204.html]
[test_bug404748.html]
-[test_bug406375.html]
-skip-if = toolkit == 'android'
-[test_bug414291.html]
-tags = openwindow
[test_bug427744.html]
skip-if = toolkit == 'android'
[test_bug42976.html]
[test_bug430276.html]
-[test_bug437361.html]
skip-if = toolkit == 'android'
[test_bug440572.html]
[test_bug456151.html]
[test_bug458091.html]
[test_bug459848.html]
[test_bug465263.html]
-[test_bug479143.html]
skip-if = toolkit == 'android'
[test_bug484775.html]
[test_bug492925.html]
[test_bug49312.html]
[test_bug495219.html]
-[test_bug504862.html]
skip-if = toolkit == 'android' #RANDOM
[test_bug529328.html]
[test_bug531176.html]
@@ -126,7 +115,6 @@ skip-if = toolkit == 'android'
[test_bug698061.html]
[test_bug698551.html]
[test_bug707749.html]
-[test_bug735237.html]
[test_bug739038.html]
[test_bug740811.html]
[test_bug743615.html]
diff --git a/dom/tests/mochitest/bugs/test_bug291653.html b/dom/tests/mochitest/bugs/test_bug291653.html
deleted file mode 100644
index 1543cdd96..000000000
--- a/dom/tests/mochitest/bugs/test_bug291653.html
+++ /dev/null
@@ -1,56 +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() {
- if ("showModalDialog" in window) {
- w = window.open("file_bug291653.html", "foo", "width=300,height=300");
- } else {
- // window.showModalDialog doesn't exist in e10s mode, nothing to do in this test.
- ok(true, "nothing to do in e10s mode");
- SimpleTest.finish();
- }
-}
-
-function closeTest() {
- w.setTimeout("close()", 0);
- setTimeout("finish()", 500);
-}
-
-function finish() {
- ok(!secondListenerDidRun, "Shouldn't have run second listener!");
- SimpleTest.finish();
-}
-
-function end() {
- setTimeout("closeTest()", 500);
-}
-
-start();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/tests/mochitest/bugs/test_bug406375.html b/dom/tests/mochitest/bugs/test_bug406375.html
deleted file mode 100644
index 2cd459ffa..000000000
--- a/dom/tests/mochitest/bugs/test_bug406375.html
+++ /dev/null
@@ -1,37 +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();
-
-function runTest() {
- if ("showModalDialog" in window) {
- window.showModalDialog("file_bug406375.html");
- }
- ok(true, "This test should not hang");
-
- SimpleTest.finish();
-}
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/tests/mochitest/bugs/test_bug414291.html b/dom/tests/mochitest/bugs/test_bug414291.html
index 883e52bb4..0ee5cb393 100644
--- a/dom/tests/mochitest/bugs/test_bug414291.html
+++ b/dom/tests/mochitest/bugs/test_bug414291.html
@@ -16,7 +16,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=414291
var result1 = 0;
var result2 = 0;
-var result3 = 0;
window.open("data:text/html,<html><body onload='close(); opener.result1 = 1;'>", "w1");
is(result1, 0, "window should not be opened either as modal or loaded synchronously.");
@@ -24,11 +23,6 @@ is(result1, 0, "window should not be opened either as modal or loaded synchronou
window.open("data:text/html,<html><body onload='close(); opener.result2 = 2;'>", "w2", "modal=yes");
is(result2, 0, "window should not be opened either as modal or data loaded synchronously.");
-if (window.showModalDialog) {
- result3 = window.showModalDialog("data:text/html,<html><body onload='close(); returnValue = 3;'>");
- is(result3, 3, "window should be opened as modal.");
-}
-
</script>
</pre>
</body>
diff --git a/dom/tests/mochitest/bugs/test_bug437361.html b/dom/tests/mochitest/bugs/test_bug437361.html
deleted file mode 100644
index ecc2cb08d..000000000
--- a/dom/tests/mochitest/bugs/test_bug437361.html
+++ /dev/null
@@ -1,72 +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
- "data:text/html,<html><body onload='close(); returnValue = 1;' /></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
- "data:text/html,<html><body onload='close(); returnValue = 1;' /></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) {
- if ("showModalDialog" in window) {
- 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);
- }
- } else {
- ok(true, "nothing to do in e10s mode");
- }
- }
-
- 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.");
-
- </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>
-
diff --git a/dom/tests/mochitest/bugs/test_bug479143.html b/dom/tests/mochitest/bugs/test_bug479143.html
deleted file mode 100644
index 03db4ddea..000000000
--- a/dom/tests/mochitest/bugs/test_bug479143.html
+++ /dev/null
@@ -1,44 +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();
-
- setTimeout(function() {
- if ("showModalDialog" in window) {
- 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();
- }, 0);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/tests/mochitest/bugs/test_bug504862.html b/dom/tests/mochitest/bugs/test_bug504862.html
deleted file mode 100644
index 713165bc3..000000000
--- a/dom/tests/mochitest/bugs/test_bug504862.html
+++ /dev/null
@@ -1,45 +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.");
-}
-
-function runTest() {
- if ("showModalDialog" in window) {
- window.addEventListener("message", onMsgRcv, false);
-
- 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.");
- } else {
- ok(true, "nothing to do in e10s mode");
- }
-
- SimpleTest.finish();
-}
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/tests/mochitest/bugs/test_bug61098.html b/dom/tests/mochitest/bugs/test_bug61098.html
index 4c6ce967d..ed16e099b 100644
--- a/dom/tests/mochitest/bugs/test_bug61098.html
+++ b/dom/tests/mochitest/bugs/test_bug61098.html
@@ -306,28 +306,6 @@ function runtestsInner()
w.close();
- // 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();
diff --git a/dom/tests/mochitest/bugs/test_bug735237.html b/dom/tests/mochitest/bugs/test_bug735237.html
deleted file mode 100644
index e1a25a425..000000000
--- a/dom/tests/mochitest/bugs/test_bug735237.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=735237
--->
-<head>
- <title>Test for Bug 735237</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=735237">Mozilla Bug 735237</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 735237 **/
-
-SimpleTest.waitForExplicitFinish();
-
-SpecialPowers.pushPrefEnv({"set": [["dom.disable_window_showModalDialog", true]]}, function() {
- var caughtException = false;
- try {
- window.showModalDialog("http://example.com/");
- } catch (e) {
- caughtException = true;
- }
- ok(caughtException, "showModalDialog should throw an exception");
- SimpleTest.finish();
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/tests/mochitest/general/file_showModalDialog.html b/dom/tests/mochitest/general/file_showModalDialog.html
deleted file mode 100644
index 1cae0b1c0..000000000
--- 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>
diff --git a/dom/tests/mochitest/general/mochitest.ini b/dom/tests/mochitest/general/mochitest.ini
index d00ea1d4b..9f2fad785 100755
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -9,7 +9,6 @@ support-files =
file_interfaces.xml
file_moving_nodeList.html
file_moving_xhr.html
- file_showModalDialog.html
historyframes.html
image_50.png
image_100.png
@@ -116,8 +115,6 @@ support-files = test_offsets.js
[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_e10s.html]
run-if = e10s
[test_storagePermissionsAccept.html]
diff --git a/dom/tests/mochitest/general/test_showModalDialog.html b/dom/tests/mochitest/general/test_showModalDialog.html
deleted file mode 100644
index 511c79e63..000000000
--- a/dom/tests/mochitest/general/test_showModalDialog.html
+++ /dev/null
@@ -1,60 +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();
- };
-
- 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(showModalDialog('file_showModalDialog.html'), "rv: undefined");
- is(showModalDialog(xurl), undefined);
- is(showModalDialog('file_showModalDialog.html', 3), "rv: 3");
- is(showModalDialog(xurl, 3), undefined);
- is(showModalDialog('file_showModalDialog.html', someObj), "rv: " + someObj);
- is(showModalDialog(xurl, someObj), undefined);
-
- // Test sequential navigations.
- is(showModalDialog('file_showModalDialog.html?http://mochi.test:8888', 4),
- 'rv: 4');
- is(showModalDialog('file_showModalDialog.html?http://example.com', 4), undefined);
- is(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();
-
- </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>