Backed out 4 changesets (bug 981796) for android failures in test_bug414291.html a=backout

Backed out changeset fe6569eae4ef (bug 981796)
Backed out changeset eca1651af3d3 (bug 981796)
Backed out changeset 5a1e684a1494 (bug 981796)
Backed out changeset 7f91ff196c93 (bug 981796)

MozReview-Commit-ID: COSf2kvo6c7
This commit is contained in:
Wes Kocher 2017-06-19 16:41:55 -07:00
Родитель 8c47606640
Коммит 3923267017
20 изменённых файлов: 132 добавлений и 186 удалений

Просмотреть файл

@ -10119,12 +10119,8 @@ nsGlobalWindow::ShowModalDialog(JSContext* aCx, const nsAString& aUrl,
JS::Rooted<JS::Value> result(aCx);
if (retVal) {
JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
if (!global) {
global = FastGetGlobalJSObject();
}
aError = nsContentUtils::XPConnect()->VariantToJS(aCx,
global,
FastGetGlobalJSObject(),
retVal, aRetval);
} else {
aRetval.setNull();

Просмотреть файл

@ -16,16 +16,8 @@
*/
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; \
function openModal() {
showModalDialog("javascript:opener.winRef = window; \
window.opener.setTimeout(\'winRef.dialogArguments;\', 0);\
window.close();");

Просмотреть файл

@ -487,14 +487,7 @@ function testSyncXHR2() {
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;
function testModalDialog() {
var didHandleCallback = false;
div.innerHTML = "<span>1</span><span>2</span>";
m = new M(function(records, observer) {

Просмотреть файл

@ -14,23 +14,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391777
<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();
}
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");
</script>
</body>

Просмотреть файл

@ -109,9 +109,7 @@ function doTest() {
// 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);
addLoadEvent(doTest);
</script>
<body>

Просмотреть файл

@ -59,7 +59,7 @@ skip-if = toolkit == 'android'
[test_bug265203.html]
[test_bug291377.html]
[test_bug291653.html]
skip-if = e10s || toolkit == 'android' #TIMED_OUT
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug304459.html]
[test_bug308856.html]
[test_bug327891.html]
@ -82,7 +82,7 @@ skip-if = toolkit == 'android' #TIMED_OUT
[test_bug400204.html]
[test_bug404748.html]
[test_bug406375.html]
skip-if = e10s || toolkit == 'android'
skip-if = toolkit == 'android'
[test_bug414291.html]
tags = openwindow
[test_bug427744.html]
@ -90,20 +90,20 @@ skip-if = toolkit == 'android'
[test_bug42976.html]
[test_bug430276.html]
[test_bug437361.html]
skip-if = e10s || toolkit == 'android'
skip-if = 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'
skip-if = toolkit == 'android'
[test_bug484775.html]
[test_bug492925.html]
[test_bug49312.html]
[test_bug495219.html]
[test_bug504862.html]
skip-if = e10s || toolkit == 'android' #RANDOM
skip-if = toolkit == 'android' #RANDOM
[test_bug529328.html]
[test_bug531176.html]
[test_bug531542.html]

Просмотреть файл

@ -25,7 +25,13 @@ var secondListenerDidRun = false;
var w;
function start() {
w = window.open("file_bug291653.html", "foo", "width=300,height=300");
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() {
@ -42,7 +48,7 @@ function end() {
setTimeout("closeTest()", 500);
}
SpecialPowers.pushPrefEnv({ set: [[ "dom.disable_window_showModalDialog", false ]] }, start);
start();
</script>
</pre>

Просмотреть файл

@ -22,16 +22,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=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");
function runTest() {
if ("showModalDialog" in window) {
window.showModalDialog("file_bug406375.html");
}
ok(true, "This test should not hang");
SimpleTest.finish();

Просмотреть файл

@ -13,7 +13,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=414291
<script class="testbody" type="text/javascript">
/** Test for Bug 414291 **/
SimpleTest.waitForExplicitFinish();
var result1 = 0;
var result2 = 0;
@ -25,20 +24,9 @@ is(result1, 0, "window should not be opened either as modal or loaded synchronou
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();
if (window.showModalDialog) {
result3 = window.showModalDialog("file3_bug414291.html");
is(result3, 3, "window should be opened as modal.");
}
</script>

Просмотреть файл

@ -32,41 +32,32 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=437361
}
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);
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");
}
}
SimpleTest.waitForExplicitFinish();
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.");
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(false, true, testOtherExceptionsNotTrapped,
"Incorrectly suppressed insecure showModalDialog exception.");
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>

Просмотреть файл

@ -18,32 +18,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=479143
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;
setTimeout(function() {
if ("showModalDialog" in window) {
var interval = setInterval(function() { var i = 0; i++; }, 10);
var interval = setInterval(function() { var i = 0; i++; }, 10);
var xhr = new XMLHttpRequest();
xhr.open("GET", "test_bug479143.html", false);
xhr.send(null);
var xhr = new XMLHttpRequest();
xhr.open("GET", "test_bug479143.html", false);
xhr.send(null);
window.showModalDialog("javascript:" +
"setTimeout(function() { window.close(); }, 1000);",
null);
window.showModalDialog("javascript:" +
"setTimeout(function() { window.close(); }, 1000);",
null);
clearInterval(interval);
clearInterval(interval);
}
ok(true, "did not crash");
SimpleTest.finish();
}
}, 0);
</script>
</pre>

Просмотреть файл

@ -19,26 +19,22 @@ 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;
function runTest() {
if ("showModalDialog" in window) {
window.addEventListener("message", onMsgRcv);
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.");
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");
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.");
is(result, undefined, "Able to see return value from cross origin dialog.");
} else {
ok(true, "nothing to do in e10s mode");
}
SimpleTest.finish();
}

Просмотреть файл

@ -220,12 +220,11 @@ var expectedState;
function runtests()
{
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3],
["dom.disable_window_showModalDialog", false]]},
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3]]},
runtestsInner);
}
async function runtestsInner()
function runtestsInner()
{
registerMockPromptService();
@ -306,13 +305,6 @@ async function runtestsInner()
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) {

Просмотреть файл

@ -124,7 +124,8 @@ support-files = test_offsets.js
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_showModalDialog_e10s.html]
run-if = e10s
[test_storagePermissionsAccept.html]
[test_storagePermissionsLimitForeign.html]
[test_storagePermissionsReject.html]

Просмотреть файл

@ -24,40 +24,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=862918
win.wrappedJSObject.go();
};
SimpleTest.waitForExplicitFinish();
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);
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 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');
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();
}
// This test used to assert after gc. Make sure it doesn't.
SpecialPowers.gc();
</script>
</head>

Просмотреть файл

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1077002
<pre id="test">
<script type="application/javascript">
/** Test for showModalDialog unavailability in Firefox **/
/** Test for showModalDialog unavailability in e10s **/
// NB: This test runs in e10s only. In e10s showModalDialog should not
// exist.

Просмотреть файл

@ -1221,7 +1221,6 @@ pref("dom.disable_window_open_feature.menubar", false);
pref("dom.disable_window_open_feature.resizable", true);
pref("dom.disable_window_open_feature.minimizable", false);
pref("dom.disable_window_open_feature.status", true);
pref("dom.disable_window_showModalDialog", true);
pref("dom.allow_scripts_to_close_windows", false);

Просмотреть файл

@ -0,0 +1,15 @@
[historical.window.html]
type: testharness
[showModalDialog() has been removed from the platform]
expected:
if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
if not debug and not e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
if not debug and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL

Просмотреть файл

@ -8,3 +8,8 @@
[A SecurityError exception must be thrown when window.onmousewheel is accessed from a different origin.]
expected: FAIL
[A SecurityError exception must be thrown when window.showModalDialog is accessed from a different origin.]
disabled:
if e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=981796

Просмотреть файл

@ -1477,6 +1477,10 @@
[DataTransfer interface object length]
expected: FAIL
[Window interface: operation showModalDialog(DOMString,any)]
disabled:
if e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=981796
[Window interface: attribute oncancel]
expected: FAIL
@ -1492,6 +1496,10 @@
[Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long)]
expected: FAIL
[Window interface: window must inherit property "showModalDialog" with the proper type (34)]
disabled:
if e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=981796
[Window interface: window must inherit property "oncancel" with the proper type (42)]
expected: FAIL
@ -1504,6 +1512,10 @@
[Window interface: window must inherit property "onsort" with the proper type (93)]
expected: FAIL
[Window interface: calling showModalDialog(DOMString,any) on window with too few arguments must throw TypeError]
disabled:
if e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=981796
[Window interface: calling createImageBitmap(ImageBitmapSource,long,long,long,long) on window with too few arguments must throw TypeError]
expected: FAIL