Backed out 1 changesets (bug 1691954) for bc failures on browser_startup_content_subframe.js. CLOSED TREE

Backed out changeset 18366efe3ea2 (bug 1691954)
This commit is contained in:
Cosmin Sabou 2021-09-29 20:23:15 +03:00
Родитель 0d612db0fb
Коммит 78019683ed
5 изменённых файлов: 18 добавлений и 67 удалений

Просмотреть файл

@ -13,8 +13,6 @@ const { XPCOMUtils } = ChromeUtils.import(
);
XPCOMUtils.defineLazyModuleGetters(this, {
Services: "resource://gre/modules/Services.jsm",
event: "chrome://remote/content/marionette/event.js",
Log: "chrome://remote/content/shared/Log.jsm",
});
@ -41,13 +39,6 @@ class MarionetteEventsChild extends JSWindowActorChild {
}
handleEvent({ target, type }) {
if (!Services.cpmm.sharedData.get("MARIONETTE_EVENTS_ENABLED")) {
// The parent process will set MARIONETTE_EVENTS_ENABLED to false when
// the Marionette session ends to avoid unnecessary inter process
// communications
return;
}
// Ignore invalid combinations of load events and document's readyState.
if (
(type === "DOMContentLoaded" && target.readyState != "interactive") ||

Просмотреть файл

@ -5,10 +5,10 @@
("use strict");
const EXPORTED_SYMBOLS = [
"disableEventsActor",
"enableEventsActor",
"EventDispatcher",
"MarionetteEventsParent",
"registerEventsActor",
"unregisterEventsActor",
];
const { XPCOMUtils } = ChromeUtils.import(
@ -16,8 +16,6 @@ const { XPCOMUtils } = ChromeUtils.import(
);
XPCOMUtils.defineLazyModuleGetters(this, {
Services: "resource://gre/modules/Services.jsm",
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
});
@ -49,17 +47,10 @@ class MarionetteEventsParent extends JSWindowActorParent {
}
}
// Flag to check if the MarionetteEvents actors have already been registed.
let eventsActorRegistered = false;
/**
* Register Events actors to listen for page load events via EventDispatcher.
*/
function registerEventsActor() {
if (eventsActorRegistered) {
return;
}
try {
// Register the JSWindowActor pair for events as used by Marionette
ChromeUtils.registerWindowActor("MarionetteEvents", {
@ -89,8 +80,6 @@ function registerEventsActor() {
allFrames: true,
includeChrome: true,
});
eventsActorRegistered = true;
} catch (e) {
if (e.name === "NotSupportedError") {
logger.warn(`MarionetteEvents actor is already registered!`);
@ -100,25 +89,6 @@ function registerEventsActor() {
}
}
/**
* Enable MarionetteEvents actors to start forwarding page load events from the
* child actor to the parent actor. Register the MarionetteEvents actor if necessary.
*/
function enableEventsActor() {
// sharedData is replicated across processes and will be checked by
// MarionetteEventsChild before forward events to the parent actor.
Services.ppmm.sharedData.set("MARIONETTE_EVENTS_ENABLED", true);
// Request to immediately flush the data to the content processes to avoid races.
Services.ppmm.sharedData.flush();
registerEventsActor();
}
/**
* Disable MarionetteEvents actors to stop forwarding page load events from the
* child actor to the parent actor.
*/
function disableEventsActor() {
Services.ppmm.sharedData.set("MARIONETTE_EVENTS_ENABLED", false);
Services.ppmm.sharedData.flush();
function unregisterEventsActor() {
ChromeUtils.unregisterWindowActor("MarionetteEvents");
}

Просмотреть файл

@ -26,11 +26,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
Context: "chrome://remote/content/marionette/browser.js",
cookie: "chrome://remote/content/marionette/cookie.js",
DebounceCallback: "chrome://remote/content/marionette/sync.js",
disableEventsActor:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
element: "chrome://remote/content/marionette/element.js",
enableEventsActor:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
getMarionetteCommandsActorProxy:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
@ -47,6 +43,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
reftest: "chrome://remote/content/marionette/reftest.js",
registerCommandsActor:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
registerEventsActor:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
TimedPromise: "chrome://remote/content/marionette/sync.js",
Timeouts: "chrome://remote/content/shared/webdriver/Capabilities.jsm",
@ -54,6 +52,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
"chrome://remote/content/shared/webdriver/Capabilities.jsm",
unregisterCommandsActor:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
unregisterEventsActor:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
waitForLoadEvent: "chrome://remote/content/marionette/sync.js",
waitForObserverTopic: "chrome://remote/content/marionette/sync.js",
WebDriverSession: "chrome://remote/content/shared/webdriver/Session.jsm",
@ -434,7 +434,7 @@ GeckoDriver.prototype.newSession = async function(cmd) {
}
registerCommandsActor();
enableEventsActor();
registerEventsActor();
for (let win of windowManager.windows) {
const tabBrowser = browser.getTabBrowser(win);
@ -2108,10 +2108,7 @@ GeckoDriver.prototype.deleteSession = function() {
// Always unregister actors after all other observers
// and listeners have been removed.
unregisterCommandsActor();
// MarionetteEvents actors are only disabled to avoid IPC errors if there are
// in flight events being forwarded from the content process to the parent
// process.
disableEventsActor();
unregisterEventsActor();
if (RemoteAgent.webDriverBiDi) {
RemoteAgent.webDriverBiDi.deleteSession();

Просмотреть файл

@ -11,13 +11,13 @@ const {
} = ChromeUtils.import(
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm"
);
const { enableEventsActor, disableEventsActor } = ChromeUtils.import(
const { registerEventsActor, unregisterEventsActor } = ChromeUtils.import(
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm"
);
registerCleanupFunction(function() {
unregisterCommandsActor();
disableEventsActor();
unregisterEventsActor();
});
add_test(function test_commandsActor_register() {
@ -49,13 +49,13 @@ add_test(async function test_commandsActor_getActorProxy_noBrowsingContext() {
run_next_test();
});
add_test(function test_eventsActor_enable_disable() {
enableEventsActor();
disableEventsActor();
add_test(function test_eventsActor_register() {
registerEventsActor();
unregisterEventsActor();
enableEventsActor();
enableEventsActor();
disableEventsActor();
registerEventsActor();
registerEventsActor();
unregisterEventsActor();
run_next_test();
});

Просмотреть файл

@ -376,13 +376,6 @@ class TestNavigate(BaseNavigationTestCase):
)
self.assertTrue(self.is_remote_tab)
def test_navigate_after_deleting_session(self):
self.marionette.delete_session()
self.marionette.start_session()
self.marionette.navigate(self.test_page_remote)
self.assertEqual(self.test_page_remote, self.marionette.get_url())
class TestBackForwardNavigation(BaseNavigationTestCase):
def run_bfcache_test(self, test_pages):