mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 898512 - Tests for navigator.mozSettings behavior. r=gwagner
This commit is contained in:
parent
962b35dcaa
commit
0ea16f4845
@ -16,6 +16,7 @@ MOCHITEST_FILES = \
|
||||
test_settings_events.html \
|
||||
test_settings_onsettingchange.html \
|
||||
test_settings_blobs.html \
|
||||
test_settings_navigator_object.html \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
|
43
dom/settings/tests/test_settings_navigator_object.html
Normal file
43
dom/settings/tests/test_settings_navigator_object.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=898512
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 898512 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=898512">Mozilla Bug 898512</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<iframe></iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript;version=1.7">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function testPref() {
|
||||
SpecialPowers.pushPrefEnv({
|
||||
set: [["dom.mozSettings.enabled", false]]
|
||||
}, function() {
|
||||
ise(navigator.mozSettings, undefined, "navigator.mozSettings is undefined");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
SpecialPowers.pushPermissions([
|
||||
{type: "settings-read", allow: 0, context: document},
|
||||
{type: "settings-write", allow: 0, context: document}
|
||||
], function() {
|
||||
ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions");
|
||||
testPref();
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user