Bug 1234700 - Hide window.showModalDialog when e10s is enabled. r=jimm

--HG--
rename : dom/tests/mochitest/general/test_bug1077002.html => dom/tests/mochitest/general/test_showModalDialog_e10s.html
This commit is contained in:
Masatoshi Kimura 2015-12-29 23:47:46 +09:00
parent 1e7ba06546
commit a236e77645
4 changed files with 24 additions and 13 deletions

View File

@ -4282,7 +4282,7 @@ nsGlobalWindow::IsShowModalDialogEnabled(JSContext*, JSObject*)
sAddedPrefCache = true;
}
return !sIsDisabled;
return !sIsDisabled && !XRE_IsContentProcess();
}
nsIDOMOfflineResourceList*
@ -8790,7 +8790,7 @@ nsGlobalWindow::ShowModalDialogOuter(const nsAString& aUrl, nsIVariant* aArgumen
mDoc->WarnOnceAbout(nsIDocument::eShowModalDialog);
}
if (!IsShowModalDialogEnabled() || XRE_IsContentProcess()) {
if (!IsShowModalDialogEnabled()) {
aError.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;
}

View File

@ -56,8 +56,6 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_bug653364.html]
[test_bug861217.html]
[test_bug1077002.html]
run-if = e10s
[test_clientRects.html]
[test_clipboard_events.html]
skip-if = e10s || buildapp == 'b2g' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
@ -101,6 +99,8 @@ skip-if = buildapp == 'b2g' || buildapp == 'mulet'
[test_srcset_pref.html]
[test_showModalDialog.html]
skip-if = e10s || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #Don't run modal tests on Android # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
[test_showModalDialog_e10s.html]
run-if = e10s
[test_stylesheetPI.html]
[test_vibrator.html]
skip-if = toolkit == 'android' #CRASH_SUTAGENT

View File

@ -4,7 +4,7 @@
https://bugzilla.mozilla.org/show_bug.cgi?id=1077002
-->
<head>
<title>Test for Bug 1077002</title>
<title>Test for showModalDialog unavailability in e10s</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
@ -20,15 +20,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1077002
<pre id="test">
<script type="application/javascript;version=1.7">
/** Test for Bug 1077002 **/
/** Test for showModalDialog unavailability in e10s **/
try {
// NB: This test runs in e10s only. In e10s showModalDialog should only
// ever throw NS_ERROR_NOT_AVAILABLE.
window.showModalDialog("http://example.org");
} catch (e) {
is(e.name, "NS_ERROR_NOT_AVAILABLE", "throw the correct error message");
}
// NB: This test runs in e10s only. In e10s showModalDialog should not
// exist.
ok(!window.showModalDialog, "showModalDialog should not exist");
</script>
</pre>

View File

@ -1993,6 +1993,11 @@
[DataTransferItem interface: operation getAsFile()]
expected: FAIL
[Window interface: operation showModalDialog(DOMString,any)]
expected:
if not e10s: PASS
FAIL
[Window interface: attribute onautocomplete]
expected: FAIL
@ -2023,6 +2028,11 @@
[Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long)]
expected: FAIL
[Window interface: window must inherit property "showModalDialog" with the proper type (34)]
expected:
if not e10s: PASS
FAIL
[Window interface: window must inherit property "onautocomplete" with the proper type (39)]
expected: FAIL
@ -2050,6 +2060,11 @@
[Window interface: window must inherit property "ontoggle" with the proper type (98)]
expected: FAIL
[Window interface: calling showModalDialog(DOMString,any) on window with too few arguments must throw TypeError]
expected:
if not e10s: PASS
FAIL
[Window interface: calling createImageBitmap(ImageBitmapSource,long,long,long,long) on window with too few arguments must throw TypeError]
expected: FAIL