Bug 1502525 - Test to verify that mochitests run with in-process extensions r=mixedpuppy

This is the counterpart to test_verify_remote_mode.html

Differential Revision: https://phabricator.services.mozilla.com/D60975

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Wu 2020-02-03 17:29:56 +00:00
parent 0b4bc1303a
commit 501b01b392
2 changed files with 33 additions and 0 deletions

View File

@ -4,6 +4,7 @@ prefs =
extensions.webextensions.remote=false
dupe-manifest = true
[test_verify_non_remote_mode.html]
[test_ext_storage_cleanup.html]
# Bug 1426514 storage_cleanup: clearing localStorage fails with oop

View File

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Verify non-remote mode</title>
<meta charset="utf-8">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script 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(async function verify_extensions_in_parent_process() {
// This test ensures we are running with the proper settings.
const { WebExtensionPolicy } = SpecialPowers.Cu.getGlobalForObject(SpecialPowers.Services);
SimpleTest.ok(!WebExtensionPolicy.useRemoteWebExtensions, "extensions running in-process");
let chromeScript = SpecialPowers.loadChromeScript(() => {
const { WebExtensionPolicy } = Cu.getGlobalForObject(Services);
Assert.ok(WebExtensionPolicy.isExtensionProcess, "parent is extension process");
this.sendAsyncMessage("checks_done");
});
await chromeScript.promiseOneMessage("checks_done");
chromeScript.destroy();
});
</script>
</body>
</html>