Backed out changeset af745bd5c209 for xpcshell test failures.
authorKris Maglione <maglione.k@gmail.com>
Thu, 28 Jul 2016 13:42:02 -0700
changeset 332252 0785fb4ba8cf297ece281f97e8a733ea547e3e6a
parent 332251 2ffdc17e68e06e837dc9d8cea0741e3f6bda8631
child 332253 028da6e786da1547fb5fb0935b17c43dbcc5ca40
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone50.0a1
backs outaf745bd5c20928ef776a7c94c76cb9c87ac77c71
Backed out changeset af745bd5c209 for xpcshell test failures. MozReview-Commit-ID: Dt6n5mRFLgN
toolkit/components/extensions/test/mochitest/mochitest.ini
toolkit/components/extensions/test/mochitest/test_ext_background_runtime_connect_params.html
toolkit/components/extensions/test/mochitest/test_ext_extension.html
toolkit/components/extensions/test/mochitest/test_ext_idle.html
toolkit/components/extensions/test/mochitest/test_ext_onmessage_removelistener.html
toolkit/components/extensions/test/mochitest/test_ext_runtime_getPlatformInfo.html
toolkit/components/extensions/test/mochitest/test_ext_runtime_sendMessage.html
toolkit/components/extensions/test/mochitest/test_ext_simple.html
toolkit/components/extensions/test/xpcshell/test_ext_background_runtime_connect_params.js
toolkit/components/extensions/test/xpcshell/test_ext_extension.js
toolkit/components/extensions/test/xpcshell/test_ext_idle.js
toolkit/components/extensions/test/xpcshell/test_ext_onmessage_removelistener.js
toolkit/components/extensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js
toolkit/components/extensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js
toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js
toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js
toolkit/components/extensions/test/xpcshell/test_ext_simple.js
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/test/mochitest/mochitest.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest.ini
@@ -30,52 +30,59 @@ support-files =
   file_script_redirect.js
   file_script_xhr.js
   file_sample.html
   redirection.sjs
   file_privilege_escalation.html
   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]
 [test_ext_contentscript.html]
 skip-if = buildapp == 'b2g' # runat != document_idle is not supported.
 [test_ext_contentscript_api_injection.html]
 [test_ext_contentscript_create_iframe.html]
 [test_ext_contentscript_devtools_metadata.html]
 [test_ext_contentscript_exporthelpers.html]
 [test_ext_contentscript_css.html]
 [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:
 [test_ext_runtime_connect.html]
 skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_runtime_connect_twoway.html]
 skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
 [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.
 [test_ext_sendmessage_reply2.html]
 skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_sendmessage_doublereply.html]
 skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
 [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]
 [test_ext_i18n.html]
 skip-if = (os == 'android') # Bug 1258975 on android.
 [test_ext_web_accessible_resources.html]
 skip-if = (os == 'android') # Bug 1258975 on android.
 [test_ext_webrequest.html]
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_background_runtime_connect_params.html
@@ -0,0 +1,81 @@
+<!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() {
+  let detected_invalid_connect_params = 0;
+  let received_ports_number = 0;
+
+  const invalid_connect_params = [
+    // too many params
+    ["fake-extensions-id", {name: "fake-conn-name"}, "unexpected third params"],
+    // invalid params format
+    [{}, {}],
+    ["fake-extensions-id", "invalid-connect-info-format"],
+  ];
+
+  const expected_detected_invalid_connect_params = invalid_connect_params.length;
+  const expected_received_ports_number = 1;
+
+  function assertInvalidConnectParamsException(params) {
+    try {
+      browser.runtime.connect(...params);
+    } catch (e) {
+      detected_invalid_connect_params++;
+      browser.test.assertTrue(e.toString().indexOf("Incorrect argument types for runtime.connect.") >= 0, "exception message is correct");
+    }
+  }
+
+  function countReceivedPorts(port) {
+    received_ports_number++;
+
+    if (port.name == "check-results") {
+      browser.runtime.onConnect.removeListener(countReceivedPorts);
+
+      browser.test.assertEq(expected_detected_invalid_connect_params, detected_invalid_connect_params, "all invalid runtime.connect params detected");
+      browser.test.assertEq(expected_received_ports_number, received_ports_number, "invalid connect should not create a port");
+
+      browser.test.notifyPass("runtime.connect invalid params");
+    }
+  }
+
+  browser.runtime.onConnect.addListener(countReceivedPorts);
+
+  for (let params of invalid_connect_params) {
+    assertInvalidConnectParamsException(params);
+  }
+
+  browser.runtime.connect(browser.runtime.id, {name: "check-results"});
+}
+
+let extensionData = {
+  background: "(" + backgroundScript.toString() + ")()",
+  manifest: {},
+  files: {},
+};
+
+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>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_extension.html
@@ -0,0 +1,73 @@
+<!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() {
+  function background() {
+    browser.extension.isAllowedIncognitoAccess().then(isAllowedIncognitoAccess => {
+      browser.test.assertEq(true, isAllowedIncognitoAccess, "isAllowedIncognitoAccess is true");
+      browser.test.notifyPass("isAllowedIncognitoAccess");
+    });
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: `(${background})()`,
+    manifest: {},
+  });
+
+  yield extension.startup();
+  yield extension.awaitFinish("isAllowedIncognitoAccess");
+  yield extension.unload();
+});
+
+add_task(function* test_in_incognito_context_false() {
+  function background() {
+    browser.test.assertEq(false, browser.extension.inIncognitoContext, "inIncognitoContext returned false");
+    browser.test.notifyPass("inIncognitoContext");
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: `(${background})()`,
+    manifest: {},
+  });
+
+  yield extension.startup();
+  yield extension.awaitFinish("inIncognitoContext");
+  yield extension.unload();
+});
+
+add_task(function* test_is_allowed_file_scheme_access() {
+  function backgroundScript() {
+    browser.extension.isAllowedFileSchemeAccess().then(isAllowedFileSchemeAccess => {
+      browser.test.assertEq(false, isAllowedFileSchemeAccess, "isAllowedFileSchemeAccess is false");
+      browser.test.notifyPass("isAllowedFileSchemeAccess");
+    });
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: `(${backgroundScript})()`,
+    manifest: {},
+  });
+
+  yield extension.startup();
+  info("extension loaded");
+  yield extension.awaitFinish("isAllowedFileSchemeAccess");
+  yield extension.unload();
+  info("extension unloaded");
+});
+
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_idle.html
@@ -0,0 +1,43 @@
+<!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() {
+  function background() {
+    browser.idle.queryState(15).then(status => {
+      browser.test.assertEq("active", status, "Expected status");
+      browser.test.notifyPass("idle");
+    },
+    e => {
+      browser.test.fail(`Error: ${e} :: ${e.stack}`);
+      browser.test.notifyFail("idle");
+    });
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: `(${background})()`,
+
+    manifest: {
+      permissions: ["idle"],
+    },
+  });
+
+  yield extension.startup();
+
+  yield extension.awaitFinish("idle");
+
+  yield extension.unload();
+});
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_onmessage_removelistener.html
@@ -0,0 +1,47 @@
+<!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() {
+  function listener() {
+    browser.test.notifyFail("listener should not be invoked");
+  }
+
+  browser.runtime.onMessage.addListener(listener);
+  browser.runtime.onMessage.removeListener(listener);
+  browser.runtime.sendMessage("hello");
+
+  // Make sure that, if we somehow fail to remove the listener, then we'll run
+  // the listener before the test is marked as passing.
+  setTimeout(function() {
+    browser.test.notifyPass("onmessage_removelistener");
+  }, 0);
+}
+
+let extensionData = {
+  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>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_runtime_getPlatformInfo.html
@@ -0,0 +1,40 @@
+<!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() {
+  browser.runtime.getPlatformInfo(info => {
+    let validOSs = ["mac", "win", "android", "cros", "linux", "openbsd", "gonk"];
+    let validArchs = ["arm", "x86-32", "x86-64"];
+
+    browser.test.assertTrue(validOSs.indexOf(info.os) != -1, "OS is valid");
+    browser.test.assertTrue(validArchs.indexOf(info.arch) != -1, "Architecture is valid");
+    browser.test.notifyPass("runtime.getPlatformInfo");
+  });
+}
+
+let extensionData = {
+  background: "(" + backgroundScript.toString() + ")()",
+};
+
+add_task(function* test_contentscript() {
+  let extension = ExtensionTestUtils.loadExtension(extensionData);
+  yield extension.startup();
+  yield extension.awaitFinish("runtime.getPlatformInfo");
+  yield extension.unload();
+});
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_runtime_sendMessage.html
@@ -0,0 +1,85 @@
+<!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() {
+  function background() {
+    browser.runtime.onMessage.addListener((msg, sender, respond) => {
+      if (msg == "respond-now") {
+        respond(msg);
+      } else if (msg == "respond-soon") {
+        setTimeout(() => { respond(msg); }, 0);
+        return true;
+      } else if (msg == "respond-promise") {
+        return Promise.resolve(msg);
+      } else if (msg == "respond-never") {
+        return;
+      } else if (msg == "respond-error") {
+        return Promise.reject(new Error(msg));
+      } else if (msg == "throw-error") {
+        throw new Error(msg);
+      }
+    });
+
+    browser.runtime.onMessage.addListener((msg, sender, respond) => {
+      if (msg == "respond-now") {
+        respond("hello");
+      } else if (msg == "respond-now-2") {
+        respond(msg);
+      }
+    });
+
+    browser.runtime.sendMessage("respond-never", response => {
+      browser.test.fail(`Got unexpected response callback: ${response}`);
+      browser.test.notifyFail("sendMessage");
+    });
+
+    Promise.all([
+      browser.runtime.sendMessage("respond-now"),
+      browser.runtime.sendMessage("respond-now-2"),
+      new Promise(resolve => browser.runtime.sendMessage("respond-soon", resolve)),
+      browser.runtime.sendMessage("respond-promise"),
+      browser.runtime.sendMessage("respond-never"),
+
+      browser.runtime.sendMessage("respond-error").catch(error => Promise.resolve({error})),
+      browser.runtime.sendMessage("throw-error").catch(error => Promise.resolve({error})),
+    ]).then(([respondNow, respondNow2, respondSoon, respondPromise, respondNever, respondError, throwError]) => {
+      browser.test.assertEq("respond-now", respondNow, "Got the expected immediate response");
+      browser.test.assertEq("respond-now-2", respondNow2, "Got the expected immediate response from the second listener");
+      browser.test.assertEq("respond-soon", respondSoon, "Got the expected delayed response");
+      browser.test.assertEq("respond-promise", respondPromise, "Got the expected promise response");
+      browser.test.assertEq(undefined, respondNever, "Got the expected no-response resolution");
+
+      browser.test.assertEq("respond-error", respondError.error.message, "Got the expected error response");
+      browser.test.assertEq("throw-error", throwError.error.message, "Got the expected thrown error response");
+
+      browser.test.notifyPass("sendMessage");
+    }).catch(e => {
+      browser.test.fail(`Error: ${e} :: ${e.stack}`);
+      browser.test.notifyFail("sendMessage");
+    });
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: `(${background})()`,
+  });
+
+  yield extension.startup();
+  yield extension.awaitFinish("sendMessage");
+  yield extension.unload();
+});
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/mochitest/test_ext_simple.html
@@ -0,0 +1,73 @@
+<!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() {
+  let extensionData = {
+    manifest: {
+      "name": "Simple extension test",
+      "version": "1.0",
+      "manifest_version": 2,
+      "description": "",
+    },
+  };
+
+  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 backgroundScript() {
+    browser.test.log("running background script");
+
+    browser.test.onMessage.addListener((x, y) => {
+      browser.test.assertEq(x, 10, "x is 10");
+      browser.test.assertEq(y, 20, "y is 20");
+
+      browser.test.notifyPass("background test passed");
+    });
+
+    browser.test.sendMessage("running", 1);
+  }
+
+  let extensionData = {
+    background: "(" + backgroundScript.toString() + ")()",
+    manifest: {
+      "name": "Simple extension test",
+      "version": "1.0",
+      "manifest_version": 2,
+      "description": "",
+    },
+  };
+
+  let extension = ExtensionTestUtils.loadExtension(extensionData);
+  info("load complete");
+  let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
+  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>
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_background_runtime_connect_params.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
-  let detected_invalid_connect_params = 0;
-  let received_ports_number = 0;
-
-  const invalid_connect_params = [
-    // too many params
-    ["fake-extensions-id", {name: "fake-conn-name"}, "unexpected third params"],
-    // invalid params format
-    [{}, {}],
-    ["fake-extensions-id", "invalid-connect-info-format"],
-  ];
-
-  const expected_detected_invalid_connect_params = invalid_connect_params.length;
-  const expected_received_ports_number = 1;
-
-  function assertInvalidConnectParamsException(params) {
-    try {
-      browser.runtime.connect(...params);
-    } catch (e) {
-      detected_invalid_connect_params++;
-      browser.test.assertTrue(e.toString().indexOf("Incorrect argument types for runtime.connect.") >= 0, "exception message is correct");
-    }
-  }
-
-  function countReceivedPorts(port) {
-    received_ports_number++;
-
-    if (port.name == "check-results") {
-      browser.runtime.onConnect.removeListener(countReceivedPorts);
-
-      browser.test.assertEq(expected_detected_invalid_connect_params, detected_invalid_connect_params, "all invalid runtime.connect params detected");
-      browser.test.assertEq(expected_received_ports_number, received_ports_number, "invalid connect should not create a port");
-
-      browser.test.notifyPass("runtime.connect invalid params");
-    }
-  }
-
-  browser.runtime.onConnect.addListener(countReceivedPorts);
-
-  for (let params of invalid_connect_params) {
-    assertInvalidConnectParamsException(params);
-  }
-
-  browser.runtime.connect(browser.runtime.id, {name: "check-results"});
-}
-
-let extensionData = {
-  background: backgroundScript,
-  manifest: {},
-  files: {},
-};
-
-add_task(function* test_backgroundRuntimeConnectParams() {
-  let extension = ExtensionTestUtils.loadExtension(extensionData);
-  yield extension.startup();
-
-  yield extension.awaitFinish("runtime.connect invalid params");
-
-  yield extension.unload();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_extension.js
+++ /dev/null
@@ -1,55 +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_is_allowed_incognito_access() {
-  function background() {
-    browser.extension.isAllowedIncognitoAccess().then(isAllowedIncognitoAccess => {
-      browser.test.assertEq(true, isAllowedIncognitoAccess, "isAllowedIncognitoAccess is true");
-      browser.test.notifyPass("isAllowedIncognitoAccess");
-    });
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {},
-  });
-
-  yield extension.startup();
-  yield extension.awaitFinish("isAllowedIncognitoAccess");
-  yield extension.unload();
-});
-
-add_task(function* test_in_incognito_context_false() {
-  function background() {
-    browser.test.assertEq(false, browser.extension.inIncognitoContext, "inIncognitoContext returned false");
-    browser.test.notifyPass("inIncognitoContext");
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {},
-  });
-
-  yield extension.startup();
-  yield extension.awaitFinish("inIncognitoContext");
-  yield extension.unload();
-});
-
-add_task(function* test_is_allowed_file_scheme_access() {
-  function background() {
-    browser.extension.isAllowedFileSchemeAccess().then(isAllowedFileSchemeAccess => {
-      browser.test.assertEq(false, isAllowedFileSchemeAccess, "isAllowedFileSchemeAccess is false");
-      browser.test.notifyPass("isAllowedFileSchemeAccess");
-    });
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {},
-  });
-
-  yield extension.startup();
-  yield extension.awaitFinish("isAllowedFileSchemeAccess");
-  yield extension.unload();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_idle.js
+++ /dev/null
@@ -1,30 +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* testIdle() {
-  function background() {
-    browser.idle.queryState(15).then(status => {
-      browser.test.assertEq("active", status, "Expected status");
-      browser.test.notifyPass("idle");
-    },
-    e => {
-      browser.test.fail(`Error: ${e} :: ${e.stack}`);
-      browser.test.notifyFail("idle");
-    });
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-
-    manifest: {
-      permissions: ["idle"],
-    },
-  });
-
-  yield extension.startup();
-
-  yield extension.awaitFinish("idle");
-
-  yield extension.unload();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_onmessage_removelistener.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
-  function listener() {
-    browser.test.notifyFail("listener should not be invoked");
-  }
-
-  browser.runtime.onMessage.addListener(listener);
-  browser.runtime.onMessage.removeListener(listener);
-  browser.runtime.sendMessage("hello");
-
-  // Make sure that, if we somehow fail to remove the listener, then we'll run
-  // the listener before the test is marked as passing.
-  setTimeout(function() {
-    browser.test.notifyPass("onmessage_removelistener");
-  }, 0);
-}
-
-let extensionData = {
-  background: backgroundScript,
-};
-
-add_task(function* test_contentscript() {
-  let extension = ExtensionTestUtils.loadExtension(extensionData);
-  yield extension.startup();
-  yield extension.awaitFinish("onmessage_removelistener");
-  yield extension.unload();
-});
deleted file mode 100644
--- 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();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
-  browser.runtime.getPlatformInfo(info => {
-    let validOSs = ["mac", "win", "android", "cros", "linux", "openbsd", "gonk"];
-    let validArchs = ["arm", "x86-32", "x86-64"];
-
-    browser.test.assertTrue(validOSs.indexOf(info.os) != -1, "OS is valid");
-    browser.test.assertTrue(validArchs.indexOf(info.arch) != -1, "Architecture is valid");
-    browser.test.notifyPass("runtime.getPlatformInfo");
-  });
-}
-
-let extensionData = {
-  background: backgroundScript,
-};
-
-add_task(function* test_contentscript() {
-  let extension = ExtensionTestUtils.loadExtension(extensionData);
-  yield extension.startup();
-  yield extension.awaitFinish("runtime.getPlatformInfo");
-  yield extension.unload();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js
+++ /dev/null
@@ -1,70 +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* tabsSendMessageReply() {
-  function background() {
-    browser.runtime.onMessage.addListener((msg, sender, respond) => {
-      if (msg == "respond-now") {
-        respond(msg);
-      } else if (msg == "respond-soon") {
-        setTimeout(() => { respond(msg); }, 0);
-        return true;
-      } else if (msg == "respond-promise") {
-        return Promise.resolve(msg);
-      } else if (msg == "respond-never") {
-        return;
-      } else if (msg == "respond-error") {
-        return Promise.reject(new Error(msg));
-      } else if (msg == "throw-error") {
-        throw new Error(msg);
-      }
-    });
-
-    browser.runtime.onMessage.addListener((msg, sender, respond) => {
-      if (msg == "respond-now") {
-        respond("hello");
-      } else if (msg == "respond-now-2") {
-        respond(msg);
-      }
-    });
-
-    browser.runtime.sendMessage("respond-never", response => {
-      browser.test.fail(`Got unexpected response callback: ${response}`);
-      browser.test.notifyFail("sendMessage");
-    });
-
-    Promise.all([
-      browser.runtime.sendMessage("respond-now"),
-      browser.runtime.sendMessage("respond-now-2"),
-      new Promise(resolve => browser.runtime.sendMessage("respond-soon", resolve)),
-      browser.runtime.sendMessage("respond-promise"),
-      browser.runtime.sendMessage("respond-never"),
-
-      browser.runtime.sendMessage("respond-error").catch(error => Promise.resolve({error})),
-      browser.runtime.sendMessage("throw-error").catch(error => Promise.resolve({error})),
-    ]).then(([respondNow, respondNow2, respondSoon, respondPromise, respondNever, respondError, throwError]) => {
-      browser.test.assertEq("respond-now", respondNow, "Got the expected immediate response");
-      browser.test.assertEq("respond-now-2", respondNow2, "Got the expected immediate response from the second listener");
-      browser.test.assertEq("respond-soon", respondSoon, "Got the expected delayed response");
-      browser.test.assertEq("respond-promise", respondPromise, "Got the expected promise response");
-      browser.test.assertEq(undefined, respondNever, "Got the expected no-response resolution");
-
-      browser.test.assertEq("respond-error", respondError.error.message, "Got the expected error response");
-      browser.test.assertEq("throw-error", throwError.error.message, "Got the expected thrown error response");
-
-      browser.test.notifyPass("sendMessage");
-    }).catch(e => {
-      browser.test.fail(`Error: ${e} :: ${e.stack}`);
-      browser.test.notifyFail("sendMessage");
-    });
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-  });
-
-  yield extension.startup();
-  yield extension.awaitFinish("sendMessage");
-  yield extension.unload();
-});
deleted file mode 100644
--- 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();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_simple.js
+++ /dev/null
@@ -1,52 +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_simple() {
-  let extensionData = {
-    manifest: {
-      "name": "Simple extension test",
-      "version": "1.0",
-      "manifest_version": 2,
-      "description": "",
-    },
-  };
-
-  let extension = ExtensionTestUtils.loadExtension(extensionData);
-  yield extension.startup();
-  yield extension.unload();
-});
-
-add_task(function* test_background() {
-  function background() {
-    browser.test.log("running background script");
-
-    browser.test.onMessage.addListener((x, y) => {
-      browser.test.assertEq(x, 10, "x is 10");
-      browser.test.assertEq(y, 20, "y is 20");
-
-      browser.test.notifyPass("background test passed");
-    });
-
-    browser.test.sendMessage("running", 1);
-  }
-
-  let extensionData = {
-    background,
-    manifest: {
-      "name": "Simple extension test",
-      "version": "1.0",
-      "manifest_version": 2,
-      "description": "",
-    },
-  };
-
-  let extension = ExtensionTestUtils.loadExtension(extensionData);
-
-  let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
-  equal(x, 1, "got correct value from extension");
-
-  extension.sendMessage(10, 20);
-  yield extension.awaitFinish();
-  yield extension.unload();
-});
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -21,27 +21,19 @@ skip-if = os == "android"
 [test_ext_contexts.js]
 [test_ext_downloads.js]
 [test_ext_downloads_download.js]
 skip-if = os == "android"
 [test_ext_downloads_misc.js]
 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]
 [test_locale_data.js]
 [test_native_messaging.js]
 skip-if = os == "android"