mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changesets be79c6478634 and 84530975d22f (bug 898512) for B2G mochitest-4 failures.
This commit is contained in:
parent
972c91d25f
commit
dd379d3798
@ -1493,15 +1493,6 @@ Navigator::DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObject,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name.EqualsLiteral("mozSettings")) {
|
||||
bool hasPermission = CheckPermission("settings-read") ||
|
||||
CheckPermission("settings-write");
|
||||
if (!hasPermission) {
|
||||
aValue.setNull();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
domObject = construct(aCx, naviObj);
|
||||
if (!domObject) {
|
||||
return Throw<true>(aCx, NS_ERROR_FAILURE);
|
||||
|
@ -16,7 +16,6 @@ MOCHITEST_FILES = \
|
||||
test_settings_events.html \
|
||||
test_settings_onsettingchange.html \
|
||||
test_settings_blobs.html \
|
||||
test_settings_prefdisabled.html \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
|
@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={678695}
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={678695}">Mozilla Bug {678695}</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<iframe></iframe>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@ -25,6 +25,9 @@ if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/SettingsChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.addPermission("settings-read", true, document);
|
||||
SpecialPowers.addPermission("settings-write", true, document);
|
||||
|
||||
function onUnwantedSuccess() {
|
||||
ok(false, "onUnwantedSuccess: shouldn't get here");
|
||||
}
|
||||
@ -93,7 +96,7 @@ function check(o1, o2) {
|
||||
var req, req2, req3, req4, req5, req6;
|
||||
var index = 0;
|
||||
|
||||
var mozSettings;
|
||||
var mozSettings = navigator.mozSettings;
|
||||
|
||||
var steps = [
|
||||
function () {
|
||||
@ -779,19 +782,7 @@ function next() {
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
is(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions");
|
||||
SpecialPowers.pushPermissions([
|
||||
{"type": "settings-read", "allow": 1, "context": document},
|
||||
{"type": "settings-write", "allow": 1, "context": document}
|
||||
], function() {
|
||||
var frame = document.getElementsByTagName("iframe")[0];
|
||||
frame.addEventListener("load", function() {
|
||||
mozSettings = frames[0].navigator.mozSettings;
|
||||
ok(frames[0].navigator.mozSettings instanceof SettingsManager, "navigator.mozSettings is SettingsManager when the page has permissions");
|
||||
SimpleTest.executeSoon(next);
|
||||
});
|
||||
frames[0].location.reload();
|
||||
});
|
||||
addLoadEvent(next);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id={678695}
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug {678695} Settings API</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<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={678695}">Mozilla Bug {678695}</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript;version=1.7">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({
|
||||
"set": [["dom.mozSettings.enabled", false]]
|
||||
}, function() {
|
||||
is(navigator.mozSettings, undefined, "navigator.mozSettings is undefined");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user