summaryrefslogtreecommitdiffstats
path: root/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html')
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html106
1 files changed, 0 insertions, 106 deletions
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html
deleted file mode 100644
index ecea8237e..000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for WebExtension EventPage Warning</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function createEventPageExtension(eventPage) {
- function eventPageScript() {
- browser.test.log("running event page as background script");
- browser.test.sendMessage("running", 1);
- }
-
- return ExtensionTestUtils.loadExtension({
- manifest: {
- "background": eventPage,
- },
- files: {
- "event-page-script.js": eventPageScript,
- "event-page.html": `<html><head>
- <meta charset="utf-8">
- <script src="event-page-script.js"><\/script>
- </head></html>`,
- },
- });
-}
-
-add_task(function* test_eventpages() {
- // Used in other tests to prevent the monitorConsole to grip.
- SimpleTest.waitForExplicitFinish();
-
- let testCases = [
- {
- message: "testing event page running as a background page",
- eventPage: {
- "page": "event-page.html",
- "persistent": false,
- },
- },
- {
- message: "testing event page scripts running as a background page",
- eventPage: {
- "scripts": ["event-page-script.js"],
- "persistent": false,
- },
- },
- ];
-
- for (let {message, eventPage} of testCases) {
- info(message);
-
- // Wait for the expected logged warnings from the manifest validation.
- let waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, [{message: /Event pages are not currently supported./}]);
- });
-
- let extension = createEventPageExtension(eventPage);
-
- info("load complete");
- let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- is(x, 1, "got correct value from extension");
- info("test complete");
- yield extension.unload();
- info("extension unloaded successfully");
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
-
- waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, [{
- message: /Reading manifest: Error processing background.nonExistentProp: An unexpected property was found/,
- }]);
- });
-
- info("testing additional unrecognized properties on background page");
-
- extension = createEventPageExtension({
- "scripts": ["event-page-script.js"],
- "nonExistentProp": true,
- });
-
- info("load complete");
- [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- is(x, 1, "got correct value from extension");
- info("test complete");
- yield extension.unload();
- info("extension unloaded successfully");
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
- }
-});
-
-</script>
-
-</body>
-</html>