зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ec4a2f7021
Коммит
ce003f10da
|
@ -52,7 +52,6 @@ skip-if = buildapp == 'b2g' # runat != document_idle is not supported.
|
|||
[test_ext_exclude_include_globs.html]
|
||||
[test_ext_i18n_css.html]
|
||||
[test_ext_generate.html]
|
||||
[test_ext_localStorage.html]
|
||||
[test_ext_notifications.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:
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<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">
|
||||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
"use strict";
|
||||
|
||||
function backgroundScript() {
|
||||
|
@ -38,23 +27,23 @@ function backgroundScript() {
|
|||
}
|
||||
|
||||
let extensionData = {
|
||||
background: "(" + backgroundScript.toString() + ")()",
|
||||
background: backgroundScript,
|
||||
};
|
||||
|
||||
add_task(function* test_contentscript() {
|
||||
add_task(function* test_localStorage() {
|
||||
let id = "test-webextension@mozilla.com";
|
||||
const RESULTS = ["item1", "item2", "deleted", "cleared", "item1"];
|
||||
|
||||
for (let expected of RESULTS) {
|
||||
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.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_idle.js]
|
||||
[test_ext_json_parser.js]
|
||||
[test_ext_localStorage.js]
|
||||
[test_ext_manifest_content_security_policy.js]
|
||||
[test_ext_manifest_incognito.js]
|
||||
[test_ext_onmessage_removelistener.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче