Backed out changeset af745bd5c209 for xpcshell test failures.

MozReview-Commit-ID: Dt6n5mRFLgN

--HG--
extra : amend_source : 2be72943ed781129bed07c3723d87b0f3d7eca9c
This commit is contained in:
Kris Maglione 2016-07-28 13:42:02 -07:00
Родитель 0ddab9429a
Коммит 55cbd3e601
11 изменённых файлов: 151 добавлений и 77 удалений

Просмотреть файл

@ -35,8 +35,10 @@ support-files =
file_ext_test_api_injection.js
file_permission_xhr.html
[test_ext_extension.html]
[test_ext_inIncognitoContext_window.html]
skip-if = os == 'android' # Android does not currently support windows.
[test_ext_simple.html]
[test_ext_geturl.html]
[test_ext_background_canvas.html]
[test_ext_content_security_policy.html]
@ -50,6 +52,8 @@ 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_idle.html]
[test_ext_onmessage_removelistener.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:
@ -60,7 +64,9 @@ skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined
[test_ext_runtime_connect2.html]
skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
[test_ext_runtime_disconnect.html]
[test_ext_runtime_getPlatformInfo.html]
[test_ext_runtime_id.html]
[test_ext_runtime_sendMessage.html]
[test_ext_sandbox_var.html]
[test_ext_sendmessage_reply.html]
skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
@ -71,6 +77,7 @@ skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2
[test_ext_storage_content.html]
[test_ext_storage_tab.html]
skip-if = os == 'android' # Android does not currently support tabs.
[test_ext_background_runtime_connect_params.html]
[test_ext_cookies.html]
[test_ext_background_api_injection.html]
[test_ext_background_generated_url.html]

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!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">
"use strict";
function backgroundScript() {
@ -49,7 +60,7 @@ function backgroundScript() {
}
let extensionData = {
background: backgroundScript,
background: "(" + backgroundScript.toString() + ")()",
manifest: {},
files: {},
};
@ -57,8 +68,14 @@ let extensionData = {
add_task(function* test_backgroundRuntimeConnectParams() {
let extension = ExtensionTestUtils.loadExtension(extensionData);
yield extension.startup();
info("extension loaded");
yield extension.awaitFinish("runtime.connect invalid params");
yield extension.unload();
info("extension unloaded");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!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">
"use strict";
add_task(function* test_is_allowed_incognito_access() {
@ -11,7 +22,7 @@ add_task(function* test_is_allowed_incognito_access() {
}
let extension = ExtensionTestUtils.loadExtension({
background,
background: `(${background})()`,
manifest: {},
});
@ -27,7 +38,7 @@ add_task(function* test_in_incognito_context_false() {
}
let extension = ExtensionTestUtils.loadExtension({
background,
background: `(${background})()`,
manifest: {},
});
@ -37,7 +48,7 @@ add_task(function* test_in_incognito_context_false() {
});
add_task(function* test_is_allowed_file_scheme_access() {
function background() {
function backgroundScript() {
browser.extension.isAllowedFileSchemeAccess().then(isAllowedFileSchemeAccess => {
browser.test.assertEq(false, isAllowedFileSchemeAccess, "isAllowedFileSchemeAccess is false");
browser.test.notifyPass("isAllowedFileSchemeAccess");
@ -45,11 +56,18 @@ add_task(function* test_is_allowed_file_scheme_access() {
}
let extension = ExtensionTestUtils.loadExtension({
background,
background: `(${backgroundScript})()`,
manifest: {},
});
yield extension.startup();
info("extension loaded");
yield extension.awaitFinish("isAllowedFileSchemeAccess");
yield extension.unload();
info("extension unloaded");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!DOCTYPE HTML>
<html>
<head>
<title>WebExtension idle API 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";
add_task(function* testIdle() {
@ -15,7 +26,7 @@ add_task(function* testIdle() {
}
let extension = ExtensionTestUtils.loadExtension({
background,
background: `(${background})()`,
manifest: {
permissions: ["idle"],
@ -28,3 +39,5 @@ add_task(function* testIdle() {
yield extension.unload();
});
</script>
</body>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!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">
"use strict";
function backgroundScript() {
@ -19,12 +30,18 @@ function backgroundScript() {
}
let extensionData = {
background: backgroundScript,
background: "(" + backgroundScript.toString() + ")()",
};
add_task(function* test_contentscript() {
let extension = ExtensionTestUtils.loadExtension(extensionData);
yield extension.startup();
info("extension loaded");
yield extension.awaitFinish("onmessage_removelistener");
yield extension.unload();
info("extension unloaded");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!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">
"use strict";
function backgroundScript() {
@ -14,7 +25,7 @@ function backgroundScript() {
}
let extensionData = {
background: backgroundScript,
background: "(" + backgroundScript.toString() + ")()",
};
add_task(function* test_contentscript() {
@ -23,3 +34,7 @@ add_task(function* test_contentscript() {
yield extension.awaitFinish("runtime.getPlatformInfo");
yield extension.unload();
});
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!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">
"use strict";
add_task(function* tabsSendMessageReply() {
@ -61,10 +72,14 @@ add_task(function* tabsSendMessageReply() {
}
let extension = ExtensionTestUtils.loadExtension({
background,
background: `(${background})()`,
});
yield extension.startup();
yield extension.awaitFinish("sendMessage");
yield extension.unload();
});
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
<!DOCTYPE HTML>
<html>
<head>
<title>Test for simple WebExtension</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";
add_task(function* test_simple() {
@ -13,12 +24,15 @@ add_task(function* test_simple() {
};
let extension = ExtensionTestUtils.loadExtension(extensionData);
info("load complete");
yield extension.startup();
info("startup complete");
yield extension.unload();
info("extension unloaded successfully");
});
add_task(function* test_background() {
function background() {
function backgroundScript() {
browser.test.log("running background script");
browser.test.onMessage.addListener((x, y) => {
@ -32,7 +46,7 @@ add_task(function* test_background() {
}
let extensionData = {
background,
background: "(" + backgroundScript.toString() + ")()",
manifest: {
"name": "Simple extension test",
"version": "1.0",
@ -42,11 +56,18 @@ add_task(function* test_background() {
};
let extension = ExtensionTestUtils.loadExtension(extensionData);
info("load complete");
let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
equal(x, 1, "got correct value from extension");
is(x, 1, "got correct value from extension");
info("startup complete");
extension.sendMessage(10, 20);
yield extension.awaitFinish();
info("test complete");
yield extension.unload();
info("extension unloaded successfully");
});
</script>
</body>
</html>

Просмотреть файл

@ -1,19 +0,0 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(function* test_connect_without_listener() {
function background() {
let port = browser.runtime.connect();
port.onDisconnect.addListener(() => {
browser.test.notifyPass("port.onDisconnect was called");
});
}
let extension = ExtensionTestUtils.loadExtension({background});
yield extension.startup();
yield extension.awaitFinish("port.onDisconnect was called");
yield extension.unload();
});

Просмотреть файл

@ -1,22 +0,0 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(function* test_sendMessage_without_listener() {
function background() {
browser.runtime.sendMessage("msg").then(reply => {
browser.test.assertEq(undefined, reply);
browser.test.notifyFail("Did not expect a reply to sendMessage");
}, error => {
browser.test.assertEq("Could not establish connection. Receiving end does not exist.", error.message);
browser.test.notifyPass("sendMessage callback was invoked");
});
}
let extension = ExtensionTestUtils.loadExtension({background});
yield extension.startup();
yield extension.awaitFinish("sendMessage callback was invoked");
yield extension.unload();
});

Просмотреть файл

@ -26,19 +26,11 @@ skip-if = os == "android"
skip-if = os == "android"
[test_ext_downloads_search.js]
skip-if = os == "android"
[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]
[test_ext_runtime_connect_no_receiver.js]
[test_ext_runtime_getPlatformInfo.js]
[test_ext_runtime_sendMessage.js]
[test_ext_runtime_sendMessage_no_receiver.js]
[test_ext_schemas.js]
[test_ext_simple.js]
[test_ext_storage.js]
[test_getAPILevelForWindow.js]
[test_locale_converter.js]