diff --git a/toolkit/components/extensions/test/mochitest/mochitest.ini b/toolkit/components/extensions/test/mochitest/mochitest.ini index 23a9daa5b0bb..3fa0e4e33404 100644 --- a/toolkit/components/extensions/test/mochitest/mochitest.ini +++ b/toolkit/components/extensions/test/mochitest/mochitest.ini @@ -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] diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_background_runtime_connect_params.js b/toolkit/components/extensions/test/mochitest/test_ext_background_runtime_connect_params.html similarity index 74% rename from toolkit/components/extensions/test/xpcshell/test_ext_background_runtime_connect_params.js rename to toolkit/components/extensions/test/mochitest/test_ext_background_runtime_connect_params.html index 008bdbbed1a9..8296ec335ca0 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_background_runtime_connect_params.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_background_runtime_connect_params.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension test + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_extension.js b/toolkit/components/extensions/test/mochitest/test_ext_extension.html similarity index 67% rename from toolkit/components/extensions/test/xpcshell/test_ext_extension.js rename to toolkit/components/extensions/test/mochitest/test_ext_extension.html index 28e4890538ad..a8d225573799 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_extension.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_extension.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension test + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_idle.js b/toolkit/components/extensions/test/mochitest/test_ext_idle.html similarity index 50% rename from toolkit/components/extensions/test/xpcshell/test_ext_idle.js rename to toolkit/components/extensions/test/mochitest/test_ext_idle.html index 8e128791d426..8e2d92383801 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_idle.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_idle.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension idle API test + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_onmessage_removelistener.js b/toolkit/components/extensions/test/mochitest/test_ext_onmessage_removelistener.html similarity index 54% rename from toolkit/components/extensions/test/xpcshell/test_ext_onmessage_removelistener.js rename to toolkit/components/extensions/test/mochitest/test_ext_onmessage_removelistener.html index 6f8b553fc6b2..eadbed1411a9 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_onmessage_removelistener.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_onmessage_removelistener.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension test + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js b/toolkit/components/extensions/test/mochitest/test_ext_runtime_getPlatformInfo.html similarity index 54% rename from toolkit/components/extensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js rename to toolkit/components/extensions/test/mochitest/test_ext_runtime_getPlatformInfo.html index 3487321d86dc..0dc80a7cf443 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_runtime_getPlatformInfo.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension test + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js b/toolkit/components/extensions/test/mochitest/test_ext_runtime_sendMessage.html similarity index 82% rename from toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js rename to toolkit/components/extensions/test/mochitest/test_ext_runtime_sendMessage.html index a85b7fb7299f..d360580ea380 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_runtime_sendMessage.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + WebExtension test + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_simple.js b/toolkit/components/extensions/test/mochitest/test_ext_simple.html similarity index 55% rename from toolkit/components/extensions/test/xpcshell/test_ext_simple.js rename to toolkit/components/extensions/test/mochitest/test_ext_simple.html index f91ec3c2c310..dd545d9c7e61 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_simple.js +++ b/toolkit/components/extensions/test/mochitest/test_ext_simple.html @@ -1,5 +1,16 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ + + + + Test for simple WebExtension + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js deleted file mode 100644 index 7c22a8a4b0dc..000000000000 --- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js +++ /dev/null @@ -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(); -}); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js deleted file mode 100644 index 6640bbe8ea22..000000000000 --- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js +++ /dev/null @@ -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(); -}); diff --git a/toolkit/components/extensions/test/xpcshell/xpcshell.ini b/toolkit/components/extensions/test/xpcshell/xpcshell.ini index 91d61ac2d1e6..51615c02adeb 100644 --- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini +++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini @@ -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]