Bug 1253030 - Remove test cases for showModalDialog in dom/tests/mochitest/bugs/. r=jimmm

--HG--
extra : rebase_source : 510e23a30edc3d36e6c29575014109c807b98ffb
This commit is contained in:
Tracy Walker 2016-03-02 15:32:24 -06:00
parent 69b696538c
commit 7bcd6a2797
4 changed files with 0 additions and 150 deletions

View File

@ -72,16 +72,12 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_bug400204.html]
[test_bug404748.html]
[test_bug406375.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s
[test_bug411103.html]
[test_bug414291.html]
[test_bug427744.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
[test_bug42976.html]
[test_bug430276.html]
[test_bug437361.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(dom.disable_open_during_load not implemented in b2g, showmodaldialog) b2g-debug(dom.disable_open_during_load not implemented in b2g, showmodaldialog) b2g-desktop(dom.disable_open_during_load not implemented in b2g, showmodaldialog)
[test_bug440572.html]
[test_bug456151.html]
[test_bug458091.html]
@ -95,8 +91,6 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e1
[test_bug49312.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_bug495219.html]
[test_bug504862.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #RANDOM # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
[test_bug529328.html]
[test_bug531176.html]
[test_bug531542.html]

View File

@ -1,35 +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() {
window.showModalDialog("file_bug406375.html");
ok(true, "This test should not hang");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

View File

@ -1,68 +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) {
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);
}
}
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>

View File

@ -1,41 +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() {
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.");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>