зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1502525 - Remove runtime changes to remote extension pref in mochitests r=mixedpuppy
The devtools tests are already unconditionally disabled (bug 1467313), so there is no loss of coverage by removing the in-process test scenario. The other two tests already pass without disabling remote extensions. Differential Revision: https://phabricator.services.mozilla.com/D60974 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
08053e0102
Коммит
0b4bc1303a
|
@ -16,7 +16,7 @@ Bug 1302702 - Test connect to a webextension addon
|
|||
<script type="application/javascript">
|
||||
"use strict";
|
||||
|
||||
async function test_connect_addon(oopMode) {
|
||||
add_task(async function test_webextension_addon_debugging_connect() {
|
||||
// Install and start a test webextension.
|
||||
const extension = ExtensionTestUtils.loadExtension({
|
||||
useAddonManager: "temporary",
|
||||
|
@ -43,7 +43,7 @@ async function test_connect_addon(oopMode) {
|
|||
ok(addonTarget, "The expected webextension target addon actor has been found");
|
||||
|
||||
// Connect to the target addon actor and wait for the updated list of frames.
|
||||
is(addonDescriptor.targetForm.isOOP, oopMode,
|
||||
is(addonDescriptor.targetForm.isOOP, true,
|
||||
"Got the expected oop mode in the webextension actor form");
|
||||
const frames = await waitForFramesUpdated(addonTarget);
|
||||
const backgroundPageFrame = frames.filter((frame) => {
|
||||
|
@ -53,16 +53,14 @@ async function test_connect_addon(oopMode) {
|
|||
|
||||
// When running in oop mode we can explicitly attach the thread without locking
|
||||
// the main process.
|
||||
if (oopMode) {
|
||||
const [, threadFront] = await addonTarget.attachThread();
|
||||
const [, threadFront] = await addonTarget.attachThread();
|
||||
|
||||
ok(threadFront, "Got a threadFront for the target addon");
|
||||
is(threadFront.paused, true, "The addon threadActor is paused");
|
||||
await threadFront.resume();
|
||||
is(threadFront.paused, false, "The addon threadActor has been resumed");
|
||||
ok(threadFront, "Got a threadFront for the target addon");
|
||||
is(threadFront.paused, true, "The addon threadActor is paused");
|
||||
await threadFront.resume();
|
||||
is(threadFront.paused, false, "The addon threadActor has been resumed");
|
||||
|
||||
await threadFront.detach();
|
||||
}
|
||||
await threadFront.detach();
|
||||
|
||||
const waitTransportClosed = new Promise(resolve => {
|
||||
client._transport.once("close", resolve);
|
||||
|
@ -78,16 +76,6 @@ async function test_connect_addon(oopMode) {
|
|||
"The debug browser has been released when the RDP connection has been closed");
|
||||
|
||||
await extension.unload();
|
||||
}
|
||||
|
||||
add_task(async function test_webextension_addon_debugging_connect_inprocess() {
|
||||
await setWebExtensionOOPMode(false);
|
||||
await test_connect_addon(false);
|
||||
});
|
||||
|
||||
add_task(async function test_webextension_addon_debugging_connect_oop() {
|
||||
await setWebExtensionOOPMode(true);
|
||||
await test_connect_addon(true);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -17,7 +17,7 @@ Bug 1302702 - Test connect to a webextension addon
|
|||
|
||||
// NOTE: This test installs the webextension addon using the addon manager, so that
|
||||
// it can be reloaded using the same actor RDP method used by the developer tools.
|
||||
async function test_reload_addon() {
|
||||
add_task(async function test_webextension_addon_debugging_reload() {
|
||||
const addonID = "test-webext-debugging-reload@test.mozilla.com";
|
||||
const addonFile = generateWebExtensionXPI({
|
||||
manifest: {
|
||||
|
@ -114,16 +114,6 @@ async function test_reload_addon() {
|
|||
// Debugging client has to be closed explicitly when
|
||||
// the target has been created as remote.
|
||||
await client.close();
|
||||
}
|
||||
|
||||
add_task(async function test_webextension_addon_debugging_reload_inprocess() {
|
||||
await setWebExtensionOOPMode(false);
|
||||
await test_reload_addon(false);
|
||||
});
|
||||
|
||||
add_task(async function test_webextension_addon_debugging_reload_oop() {
|
||||
await setWebExtensionOOPMode(true);
|
||||
await test_reload_addon(true);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* exported attachAddon, setWebExtensionOOPMode, waitForFramesUpdated, reloadAddon,
|
||||
/* exported attachAddon, waitForFramesUpdated, reloadAddon,
|
||||
collectFrameUpdates, generateWebExtensionXPI, promiseInstallFile,
|
||||
promiseWebExtensionStartup, promiseWebExtensionShutdown
|
||||
*/
|
||||
|
@ -56,12 +56,6 @@ SimpleTest.registerCleanupFunction(function() {
|
|||
|
||||
// Test helpers related to the webextensions debugging RDP actors.
|
||||
|
||||
function setWebExtensionOOPMode(oopMode) {
|
||||
return SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.remote", oopMode]],
|
||||
});
|
||||
}
|
||||
|
||||
function waitForFramesUpdated(target, matchFn) {
|
||||
return new Promise(resolve => {
|
||||
const listener = data => {
|
||||
|
|
|
@ -56,10 +56,6 @@ add_task(async function test_downloads_open_requires_user_interaction() {
|
|||
});
|
||||
|
||||
add_task(async function downloads_open_invalid_id() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.remote", false]],
|
||||
});
|
||||
|
||||
async function pageScript() {
|
||||
window.addEventListener("keypress", async function handler() {
|
||||
try {
|
||||
|
|
|
@ -155,8 +155,7 @@ function makeTest(manifestPermissions, optionalPermissions, checkFetch = true) {
|
|||
add_task(function setup() {
|
||||
// Don't bother with prompts in this test.
|
||||
return SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.remote", false],
|
||||
["extensions.webextOptionalPermissionPrompts", false]],
|
||||
set: [["extensions.webextOptionalPermissionPrompts", false]],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче