mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 13:48:23 +02:00
Bug 1288885: Migrate localStorage mochitests to xpcshell. r=aswan
MozReview-Commit-ID: 1sjpnsKYEv5 --HG-- rename : toolkit/components/extensions/test/mochitest/test_ext_localStorage.html => toolkit/components/extensions/test/xpcshell/test_ext_localStorage.js extra : rebase_source : c33f89ad30aa7785a4a12efe48cb498a1471cc72 extra : histedit_source : de6f946ab5b820efad5d75aef85055b3e8bbd50b
This commit is contained in:
parent
ec4a2f7021
commit
ce003f10da
3 changed files with 11 additions and 22 deletions
|
|
@ -52,7 +52,6 @@ skip-if = buildapp == 'b2g' # runat != document_idle is not supported.
|
||||||
[test_ext_exclude_include_globs.html]
|
[test_ext_exclude_include_globs.html]
|
||||||
[test_ext_i18n_css.html]
|
[test_ext_i18n_css.html]
|
||||||
[test_ext_generate.html]
|
[test_ext_generate.html]
|
||||||
[test_ext_localStorage.html]
|
|
||||||
[test_ext_notifications.html]
|
[test_ext_notifications.html]
|
||||||
[test_ext_permission_xhr.html]
|
[test_ext_permission_xhr.html]
|
||||||
skip-if = buildapp == 'b2g' # JavaScript error: jar:remoteopenfile:///data/local/tmp/generated-extension.xpi!/content.js, line 46: NS_ERROR_ILLEGAL_VALUE:
|
skip-if = buildapp == 'b2g' # JavaScript error: jar:remoteopenfile:///data/local/tmp/generated-extension.xpi!/content.js, line 46: NS_ERROR_ILLEGAL_VALUE:
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,5 @@
|
||||||
<!DOCTYPE HTML>
|
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||||
<html>
|
/* vim: set sts=2 sw=2 et tw=80: */
|
||||||
<head>
|
|
||||||
<title>WebExtension test</title>
|
|
||||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
<script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
|
|
||||||
<script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
|
|
||||||
<script type="text/javascript" src="head.js"></script>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function backgroundScript() {
|
function backgroundScript() {
|
||||||
|
|
@ -38,23 +27,23 @@ function backgroundScript() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let extensionData = {
|
let extensionData = {
|
||||||
background: "(" + backgroundScript.toString() + ")()",
|
background: backgroundScript,
|
||||||
};
|
};
|
||||||
|
|
||||||
add_task(function* test_contentscript() {
|
add_task(function* test_localStorage() {
|
||||||
let id = "test-webextension@mozilla.com";
|
let id = "test-webextension@mozilla.com";
|
||||||
const RESULTS = ["item1", "item2", "deleted", "cleared", "item1"];
|
const RESULTS = ["item1", "item2", "deleted", "cleared", "item1"];
|
||||||
|
|
||||||
for (let expected of RESULTS) {
|
for (let expected of RESULTS) {
|
||||||
let extension = ExtensionTestUtils.loadExtension(extensionData, id);
|
let extension = ExtensionTestUtils.loadExtension(extensionData, id);
|
||||||
let [, actual] = yield Promise.all([extension.startup(), extension.awaitMessage("result")]);
|
|
||||||
|
yield extension.startup();
|
||||||
|
|
||||||
|
let actual = yield extension.awaitMessage("result");
|
||||||
|
|
||||||
yield extension.awaitFinish("localStorage");
|
yield extension.awaitFinish("localStorage");
|
||||||
yield extension.unload();
|
yield extension.unload();
|
||||||
|
|
||||||
is(actual, expected, "got expected localStorage data");
|
equal(actual, expected, "got expected localStorage data");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -12,6 +12,7 @@ skip-if = toolkit == 'gonk' || appname == "thunderbird"
|
||||||
[test_ext_extension.js]
|
[test_ext_extension.js]
|
||||||
[test_ext_idle.js]
|
[test_ext_idle.js]
|
||||||
[test_ext_json_parser.js]
|
[test_ext_json_parser.js]
|
||||||
|
[test_ext_localStorage.js]
|
||||||
[test_ext_manifest_content_security_policy.js]
|
[test_ext_manifest_content_security_policy.js]
|
||||||
[test_ext_manifest_incognito.js]
|
[test_ext_manifest_incognito.js]
|
||||||
[test_ext_onmessage_removelistener.js]
|
[test_ext_onmessage_removelistener.js]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue