Bug 1790468 - [remote] Convert /remote/shared JSM modules to ESM r=webdriver-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D158293
This commit is contained in:
Julian Descottes 2022-09-30 11:08:06 +00:00
parent ddbec758d4
commit d1f7dbe55e
146 changed files with 689 additions and 976 deletions

View file

@ -169,7 +169,7 @@ remote/cdp/test/browser/chrome-remote-interface.js
remote/marionette/atom.js remote/marionette/atom.js
# This file explicitly has a syntax error and cannot be parsed by eslint. # This file explicitly has a syntax error and cannot be parsed by eslint.
remote/shared/messagehandler/test/browser/resources/modules/root/invalid.jsm remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs
# services/ exclusions # services/ exclusions

View file

@ -83,7 +83,7 @@ const intermittently_loaded_scripts = {
// Test related // Test related
"chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm", "chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm",
"chrome://remote/content/shared/Log.jsm", "chrome://remote/content/shared/Log.sys.mjs",
"resource://testing-common/BrowserTestUtilsChild.jsm", "resource://testing-common/BrowserTestUtilsChild.jsm",
"resource://testing-common/ContentEventListenerChild.jsm", "resource://testing-common/ContentEventListenerChild.jsm",
"resource://specialpowers/AppTestDelegateChild.jsm", "resource://specialpowers/AppTestDelegateChild.jsm",

View file

@ -72,7 +72,7 @@ const intermittently_loaded_scripts = {
// Test related // Test related
"chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm", "chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm",
"chrome://remote/content/shared/Log.jsm", "chrome://remote/content/shared/Log.sys.mjs",
"resource://testing-common/BrowserTestUtilsChild.jsm", "resource://testing-common/BrowserTestUtilsChild.jsm",
"resource://testing-common/ContentEventListenerChild.jsm", "resource://testing-common/ContentEventListenerChild.jsm",
"resource://specialpowers/SpecialPowersChild.jsm", "resource://specialpowers/SpecialPowersChild.jsm",

View file

@ -12,11 +12,14 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
RecommendedPreferences:
"chrome://remote/content/shared/RecommendedPreferences.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
JSONHandler: "chrome://remote/content/cdp/JSONHandler.jsm", JSONHandler: "chrome://remote/content/cdp/JSONHandler.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
RecommendedPreferences:
"chrome://remote/content/shared/RecommendedPreferences.jsm",
TargetList: "chrome://remote/content/cdp/targets/TargetList.jsm", TargetList: "chrome://remote/content/cdp/targets/TargetList.jsm",
}); });

View file

@ -10,14 +10,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs" "resource://gre/modules/XPCOMUtils.sys.mjs"
); );
const { WebSocketConnection } = ChromeUtils.import( const { WebSocketConnection } = ChromeUtils.importESModule(
"chrome://remote/content/shared/WebSocketConnection.jsm" "chrome://remote/content/shared/WebSocketConnection.sys.mjs"
); );
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm",
UnknownMethodError: "chrome://remote/content/cdp/Error.jsm", UnknownMethodError: "chrome://remote/content/cdp/Error.jsm",
}); });

View file

@ -17,8 +17,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -12,10 +12,13 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
HTTP_404: "chrome://remote/content/server/HTTPD.jsm", HTTP_404: "chrome://remote/content/server/HTTPD.jsm",
HTTP_505: "chrome://remote/content/server/HTTPD.jsm", HTTP_505: "chrome://remote/content/server/HTTPD.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
Protocol: "chrome://remote/content/cdp/Protocol.jsm", Protocol: "chrome://remote/content/cdp/Protocol.jsm",
RemoteAgentError: "chrome://remote/content/cdp/Error.jsm", RemoteAgentError: "chrome://remote/content/cdp/Error.jsm",
}); });

View file

@ -6,18 +6,14 @@
var EXPORTED_SYMBOLS = ["Emulation"]; var EXPORTED_SYMBOLS = ["Emulation"];
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { ContentProcessDomain } = ChromeUtils.import( const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm" "chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
); );
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
AnimationFramePromise: "chrome://remote/content/shared/Sync.jsm", AnimationFramePromise: "chrome://remote/content/shared/Sync.sys.mjs",
}); });
class Emulation extends ContentProcessDomain { class Emulation extends ContentProcessDomain {

View file

@ -19,8 +19,11 @@ const { ContentProcessDomain } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
executeSoon: "chrome://remote/content/shared/Sync.jsm",
ExecutionContext: ExecutionContext:
"chrome://remote/content/cdp/domains/content/runtime/ExecutionContext.jsm", "chrome://remote/content/cdp/domains/content/runtime/ExecutionContext.jsm",
}); });

View file

@ -16,6 +16,12 @@ const { Domain } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
PollPromise: "chrome://remote/content/shared/Sync.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
clearInterval: "resource://gre/modules/Timer.jsm", clearInterval: "resource://gre/modules/Timer.jsm",
OS: "resource://gre/modules/osfile.jsm", OS: "resource://gre/modules/osfile.jsm",
@ -24,11 +30,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
DialogHandler: DialogHandler:
"chrome://remote/content/cdp/domains/parent/page/DialogHandler.jsm", "chrome://remote/content/cdp/domains/parent/page/DialogHandler.jsm",
PollPromise: "chrome://remote/content/shared/Sync.jsm",
streamRegistry: "chrome://remote/content/cdp/domains/parent/IO.jsm", streamRegistry: "chrome://remote/content/cdp/domains/parent/IO.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
UnsupportedError: "chrome://remote/content/cdp/Error.jsm", UnsupportedError: "chrome://remote/content/cdp/Error.jsm",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
}); });
const MAX_CANVAS_DIMENSION = 32767; const MAX_CANVAS_DIMENSION = 32767;

View file

@ -16,15 +16,18 @@ const { Domain } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
ContextualIdentityService: ContextualIdentityService:
"resource://gre/modules/ContextualIdentityService.jsm", "resource://gre/modules/ContextualIdentityService.jsm",
MainProcessTarget: MainProcessTarget:
"chrome://remote/content/cdp/targets/MainProcessTarget.jsm", "chrome://remote/content/cdp/targets/MainProcessTarget.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm", TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
}); });
let browserContextIds = 1; let browserContextIds = 1;

View file

@ -31,10 +31,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.jsm", EventEmitter: "resource://gre/modules/EventEmitter.jsm",
executeSoon: "chrome://remote/content/shared/Sync.jsm",
}); });
class ContextObserver { class ContextObserver {

View file

@ -12,10 +12,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.jsm", EventEmitter: "resource://gre/modules/EventEmitter.jsm",
EventPromise: "chrome://remote/content/shared/Sync.jsm",
}); });
// TODO(ato): // TODO(ato):

View file

@ -16,9 +16,12 @@ const { Target } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm", RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm", TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm",
}); });

View file

@ -12,11 +12,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.jsm", EventEmitter: "resource://gre/modules/EventEmitter.jsm",
MainProcessTarget: MainProcessTarget:
"chrome://remote/content/cdp/targets/MainProcessTarget.jsm", "chrome://remote/content/cdp/targets/MainProcessTarget.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
TabObserver: "chrome://remote/content/cdp/observers/TargetObserver.jsm", TabObserver: "chrome://remote/content/cdp/observers/TargetObserver.jsm",
TabTarget: "chrome://remote/content/cdp/targets/TabTarget.jsm", TabTarget: "chrome://remote/content/cdp/targets/TabTarget.jsm",
}); });

View file

@ -11,8 +11,8 @@ const { RemoteAgent } = ChromeUtils.import(
const { RemoteAgentError } = ChromeUtils.import( const { RemoteAgentError } = ChromeUtils.import(
"chrome://remote/content/cdp/Error.jsm" "chrome://remote/content/cdp/Error.jsm"
); );
const { TabManager } = ChromeUtils.import( const { TabManager } = ChromeUtils.importESModule(
"chrome://remote/content/shared/TabManager.jsm" "chrome://remote/content/shared/TabManager.sys.mjs"
); );
const TIMEOUT_MULTIPLIER = SpecialPowers.isDebugBuild ? 4 : 1; const TIMEOUT_MULTIPLIER = SpecialPowers.isDebugBuild ? 4 : 1;

View file

@ -13,8 +13,8 @@ Services.scriptloader.loadSubScript(
const { Input: I } = ChromeUtils.import( const { Input: I } = ChromeUtils.import(
"chrome://remote/content/cdp/domains/parent/Input.jsm" "chrome://remote/content/cdp/domains/parent/Input.jsm"
); );
const { AppInfo } = ChromeUtils.import( const { AppInfo } = ChromeUtils.importESModule(
"chrome://remote/content/shared/AppInfo.jsm" "chrome://remote/content/shared/AppInfo.sys.mjs"
); );
const { alt, ctrl, meta, shift } = I.Modifier; const { alt, ctrl, meta, shift } = I.Modifier;

View file

@ -17,8 +17,8 @@ const {
setTimeout, setTimeout,
} = ChromeUtils.import("resource://gre/modules/Timer.jsm"); } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
const { PollPromise } = ChromeUtils.import( const { PollPromise } = ChromeUtils.importESModule(
"chrome://remote/content/shared/Sync.jsm" "chrome://remote/content/shared/Sync.sys.mjs"
); );
const BASE_ORIGIN = "https://example.com"; const BASE_ORIGIN = "https://example.com";

View file

@ -12,14 +12,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Deferred: "chrome://remote/content/shared/Sync.jsm", Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
EnvironmentPrefs: "chrome://remote/content/marionette/prefs.js", Log: "chrome://remote/content/shared/Log.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm",
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
Preferences: "resource://gre/modules/Preferences.jsm",
RecommendedPreferences: RecommendedPreferences:
"chrome://remote/content/shared/RecommendedPreferences.jsm", "chrome://remote/content/shared/RecommendedPreferences.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.jsm",
EnvironmentPrefs: "chrome://remote/content/marionette/prefs.js",
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
TCPListener: "chrome://remote/content/marionette/server.js", TCPListener: "chrome://remote/content/marionette/server.js",
}); });

View file

@ -12,11 +12,14 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
CDP: "chrome://remote/content/cdp/CDP.jsm", CDP: "chrome://remote/content/cdp/CDP.jsm",
Deferred: "chrome://remote/content/shared/Sync.jsm",
HttpServer: "chrome://remote/content/server/HTTPD.jsm", HttpServer: "chrome://remote/content/server/HTTPD.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
WebDriverBiDi: "chrome://remote/content/webdriver-bidi/WebDriverBiDi.jsm", WebDriverBiDi: "chrome://remote/content/webdriver-bidi/WebDriverBiDi.jsm",
}); });

View file

@ -13,48 +13,48 @@ remote.jar:
content/server/WebSocketTransport.jsm (server/WebSocketTransport.jsm) content/server/WebSocketTransport.jsm (server/WebSocketTransport.jsm)
# shared modules (all protocols) # shared modules (all protocols)
content/shared/AppInfo.jsm (shared/AppInfo.jsm) content/shared/AppInfo.sys.mjs (shared/AppInfo.sys.mjs)
content/shared/Format.jsm (shared/Format.jsm) content/shared/Format.sys.mjs (shared/Format.sys.mjs)
content/shared/Log.jsm (shared/Log.jsm) content/shared/Log.sys.mjs (shared/Log.sys.mjs)
content/shared/MobileTabBrowser.jsm (shared/MobileTabBrowser.jsm) content/shared/MobileTabBrowser.sys.mjs (shared/MobileTabBrowser.sys.mjs)
content/shared/Navigate.jsm (shared/Navigate.jsm) content/shared/Navigate.sys.mjs (shared/Navigate.sys.mjs)
content/shared/PDF.jsm (shared/PDF.jsm) content/shared/PDF.sys.mjs (shared/PDF.sys.mjs)
content/shared/RecommendedPreferences.jsm (shared/RecommendedPreferences.jsm) content/shared/RecommendedPreferences.sys.mjs (shared/RecommendedPreferences.sys.mjs)
content/shared/RemoteError.jsm (shared/RemoteError.jsm) content/shared/RemoteError.sys.mjs (shared/RemoteError.sys.mjs)
content/shared/Stack.jsm (shared/Stack.jsm) content/shared/Stack.sys.mjs (shared/Stack.sys.mjs)
content/shared/Sync.jsm (shared/Sync.jsm) content/shared/Sync.sys.mjs (shared/Sync.sys.mjs)
content/shared/TabManager.jsm (shared/TabManager.jsm) content/shared/TabManager.sys.mjs (shared/TabManager.sys.mjs)
content/shared/WebSocketConnection.jsm (shared/WebSocketConnection.jsm) content/shared/WebSocketConnection.sys.mjs (shared/WebSocketConnection.sys.mjs)
content/shared/WindowManager.jsm (shared/WindowManager.jsm) content/shared/WindowManager.sys.mjs (shared/WindowManager.sys.mjs)
content/shared/listeners/BrowsingContextListener.jsm (shared/listeners/BrowsingContextListener.jsm) content/shared/listeners/BrowsingContextListener.sys.mjs (shared/listeners/BrowsingContextListener.sys.mjs)
content/shared/listeners/ConsoleAPIListener.jsm (shared/listeners/ConsoleAPIListener.jsm) content/shared/listeners/ConsoleAPIListener.sys.mjs (shared/listeners/ConsoleAPIListener.sys.mjs)
content/shared/listeners/ConsoleListener.jsm (shared/listeners/ConsoleListener.jsm) content/shared/listeners/ConsoleListener.sys.mjs (shared/listeners/ConsoleListener.sys.mjs)
content/shared/listeners/LoadListener.jsm (shared/listeners/LoadListener.jsm) content/shared/listeners/LoadListener.sys.mjs (shared/listeners/LoadListener.sys.mjs)
# shared modules (messagehandler architecture) # shared modules (messagehandler architecture)
content/shared/messagehandler/Errors.jsm (shared/messagehandler/Errors.jsm) content/shared/messagehandler/Errors.sys.mjs (shared/messagehandler/Errors.sys.mjs)
content/shared/messagehandler/EventsDispatcher.jsm (shared/messagehandler/EventsDispatcher.jsm) content/shared/messagehandler/EventsDispatcher.sys.mjs (shared/messagehandler/EventsDispatcher.sys.mjs)
content/shared/messagehandler/MessageHandler.jsm (shared/messagehandler/MessageHandler.jsm) content/shared/messagehandler/MessageHandler.sys.mjs (shared/messagehandler/MessageHandler.sys.mjs)
content/shared/messagehandler/MessageHandlerRegistry.jsm (shared/messagehandler/MessageHandlerRegistry.jsm) content/shared/messagehandler/MessageHandlerRegistry.sys.mjs (shared/messagehandler/MessageHandlerRegistry.sys.mjs)
content/shared/messagehandler/Module.jsm (shared/messagehandler/Module.jsm) content/shared/messagehandler/Module.sys.mjs (shared/messagehandler/Module.sys.mjs)
content/shared/messagehandler/ModuleCache.jsm (shared/messagehandler/ModuleCache.jsm) content/shared/messagehandler/ModuleCache.sys.mjs (shared/messagehandler/ModuleCache.sys.mjs)
content/shared/messagehandler/RootMessageHandler.jsm (shared/messagehandler/RootMessageHandler.jsm) content/shared/messagehandler/RootMessageHandler.sys.mjs (shared/messagehandler/RootMessageHandler.sys.mjs)
content/shared/messagehandler/RootMessageHandlerRegistry.jsm (shared/messagehandler/RootMessageHandlerRegistry.jsm) content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs (shared/messagehandler/RootMessageHandlerRegistry.sys.mjs)
content/shared/messagehandler/WindowGlobalMessageHandler.jsm (shared/messagehandler/WindowGlobalMessageHandler.jsm) content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs (shared/messagehandler/WindowGlobalMessageHandler.sys.mjs)
content/shared/messagehandler/sessiondata/SessionData.jsm (shared/messagehandler/sessiondata/SessionData.jsm) content/shared/messagehandler/sessiondata/SessionData.sys.mjs (shared/messagehandler/sessiondata/SessionData.sys.mjs)
content/shared/messagehandler/sessiondata/SessionDataReader.jsm (shared/messagehandler/sessiondata/SessionDataReader.jsm) content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs (shared/messagehandler/sessiondata/SessionDataReader.sys.mjs)
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.jsm) content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs)
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.jsm) content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs)
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.jsm) content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs)
content/shared/messagehandler/transports/FrameContextUtils.jsm (shared/messagehandler/transports/FrameContextUtils.jsm) content/shared/messagehandler/transports/FrameContextUtils.sys.mjs (shared/messagehandler/transports/FrameContextUtils.sys.mjs)
content/shared/messagehandler/transports/FrameTransport.jsm (shared/messagehandler/transports/FrameTransport.jsm) content/shared/messagehandler/transports/FrameTransport.sys.mjs (shared/messagehandler/transports/FrameTransport.sys.mjs)
# shared modules (WebDriver HTTP / BiDi only) # shared modules (WebDriver HTTP / BiDi only)
content/shared/webdriver/Assert.jsm (shared/webdriver/Assert.jsm) content/shared/webdriver/Assert.sys.mjs (shared/webdriver/Assert.sys.mjs)
content/shared/webdriver/Capabilities.jsm (shared/webdriver/Capabilities.jsm) content/shared/webdriver/Capabilities.sys.mjs (shared/webdriver/Capabilities.sys.mjs)
content/shared/webdriver/Errors.jsm (shared/webdriver/Errors.jsm) content/shared/webdriver/Errors.sys.mjs (shared/webdriver/Errors.sys.mjs)
content/shared/webdriver/KeyData.jsm (shared/webdriver/KeyData.jsm) content/shared/webdriver/KeyData.sys.mjs (shared/webdriver/KeyData.sys.mjs)
content/shared/webdriver/Session.jsm (shared/webdriver/Session.jsm) content/shared/webdriver/Session.sys.mjs (shared/webdriver/Session.sys.mjs)
# imports from external folders # imports from external folders
content/external/EventUtils.js (../testing/mochitest/tests/SimpleTest/EventUtils.js) content/external/EventUtils.js (../testing/mochitest/tests/SimpleTest/EventUtils.js)

View file

@ -12,9 +12,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -15,15 +15,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
keyData: "chrome://remote/content/shared/webdriver/KeyData.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
pprint: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
event: "chrome://remote/content/marionette/event.js", event: "chrome://remote/content/marionette/event.js",
keyData: "chrome://remote/content/shared/webdriver/KeyData.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
pprint: "chrome://remote/content/shared/Format.jsm",
Sleep: "chrome://remote/content/marionette/sync.js", Sleep: "chrome://remote/content/marionette/sync.js",
}); });

View file

@ -14,16 +14,19 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
action: "chrome://remote/content/marionette/action.js", action: "chrome://remote/content/marionette/action.js",
atom: "chrome://remote/content/marionette/atom.js", atom: "chrome://remote/content/marionette/atom.js",
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
evaluate: "chrome://remote/content/marionette/evaluate.js", evaluate: "chrome://remote/content/marionette/evaluate.js",
event: "chrome://remote/content/marionette/event.js", event: "chrome://remote/content/marionette/event.js",
interaction: "chrome://remote/content/marionette/interaction.js", interaction: "chrome://remote/content/marionette/interaction.js",
legacyaction: "chrome://remote/content/marionette/legacyaction.js", legacyaction: "chrome://remote/content/marionette/legacyaction.js",
Log: "chrome://remote/content/shared/Log.jsm",
sandbox: "chrome://remote/content/marionette/evaluate.js", sandbox: "chrome://remote/content/marionette/evaluate.js",
Sandboxes: "chrome://remote/content/marionette/evaluate.js", Sandboxes: "chrome://remote/content/marionette/evaluate.js",
}); });

View file

@ -18,12 +18,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
capture: "chrome://remote/content/marionette/capture.js", capture: "chrome://remote/content/marionette/capture.js",
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
evaluate: "chrome://remote/content/marionette/evaluate.js", evaluate: "chrome://remote/content/marionette/evaluate.js",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -14,9 +14,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
event: "chrome://remote/content/marionette/event.js", event: "chrome://remote/content/marionette/event.js",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -17,9 +17,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.jsm", EventEmitter: "resource://gre/modules/EventEmitter.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -14,11 +14,12 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs", FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
}); });
// from https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/AddonManager#AddonInstall_errors // from https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/AddonManager#AddonInstall_errors

View file

@ -12,14 +12,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
EventPromise: "chrome://remote/content/shared/Sync.jsm",
MessageManagerDestroyedPromise: "chrome://remote/content/marionette/sync.js", MessageManagerDestroyedPromise: "chrome://remote/content/marionette/sync.js",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
WebElementEventTarget: "chrome://remote/content/marionette/dom.js", WebElementEventTarget: "chrome://remote/content/marionette/dom.js",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
}); });
/** @namespace */ /** @namespace */

View file

@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -6,16 +6,12 @@
const EXPORTED_SYMBOLS = ["cookie"]; const EXPORTED_SYMBOLS = ["cookie"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.jsm", assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
pprint: "chrome://remote/content/shared/Format.jsm", pprint: "chrome://remote/content/shared/Format.sys.mjs",
}); });
const IPV4_PORT_EXPR = /:\d+$/; const IPV4_PORT_EXPR = /:\d+$/;

View file

@ -15,8 +15,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -16,10 +16,26 @@ const { element } = ChromeUtils.import(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
pprint: "chrome://remote/content/shared/Format.sys.mjs",
print: "chrome://remote/content/shared/PDF.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
Timeouts: "chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
UnhandledPromptBehavior:
"chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
waitForInitialNavigationCompleted:
"chrome://remote/content/shared/Navigate.sys.mjs",
WebDriverSession: "chrome://remote/content/shared/webdriver/Session.sys.mjs",
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Addon: "chrome://remote/content/marionette/addon.js", Addon: "chrome://remote/content/marionette/addon.js",
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
atom: "chrome://remote/content/marionette/atom.js", atom: "chrome://remote/content/marionette/atom.js",
browser: "chrome://remote/content/marionette/browser.js", browser: "chrome://remote/content/marionette/browser.js",
capture: "chrome://remote/content/marionette/capture.js", capture: "chrome://remote/content/marionette/capture.js",
@ -32,37 +48,24 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
enableEventsActor: enableEventsActor:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
EventPromise: "chrome://remote/content/shared/Sync.jsm",
getMarionetteCommandsActorProxy: getMarionetteCommandsActorProxy:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
IdlePromise: "chrome://remote/content/marionette/sync.js", IdlePromise: "chrome://remote/content/marionette/sync.js",
l10n: "chrome://remote/content/marionette/l10n.js", l10n: "chrome://remote/content/marionette/l10n.js",
Log: "chrome://remote/content/shared/Log.jsm",
Marionette: "chrome://remote/content/components/Marionette.jsm", Marionette: "chrome://remote/content/components/Marionette.jsm",
MarionettePrefs: "chrome://remote/content/marionette/prefs.js", MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
modal: "chrome://remote/content/marionette/modal.js", modal: "chrome://remote/content/marionette/modal.js",
navigate: "chrome://remote/content/marionette/navigate.js", navigate: "chrome://remote/content/marionette/navigate.js",
permissions: "chrome://remote/content/marionette/permissions.js", permissions: "chrome://remote/content/marionette/permissions.js",
pprint: "chrome://remote/content/shared/Format.jsm",
print: "chrome://remote/content/shared/PDF.jsm",
reftest: "chrome://remote/content/marionette/reftest.js", reftest: "chrome://remote/content/marionette/reftest.js",
registerCommandsActor: registerCommandsActor:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm", RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
TimedPromise: "chrome://remote/content/marionette/sync.js", TimedPromise: "chrome://remote/content/marionette/sync.js",
Timeouts: "chrome://remote/content/shared/webdriver/Capabilities.jsm",
UnhandledPromptBehavior:
"chrome://remote/content/shared/webdriver/Capabilities.jsm",
unregisterCommandsActor: unregisterCommandsActor:
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
waitForInitialNavigationCompleted:
"chrome://remote/content/shared/Navigate.jsm",
waitForObserverTopic: "chrome://remote/content/marionette/sync.js", waitForObserverTopic: "chrome://remote/content/marionette/sync.js",
WebDriverSession: "chrome://remote/content/shared/webdriver/Session.jsm",
WebReference: "chrome://remote/content/marionette/element.js", WebReference: "chrome://remote/content/marionette/element.js",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
WindowState: "chrome://remote/content/marionette/browser.js", WindowState: "chrome://remote/content/marionette/browser.js",
}); });

View file

@ -19,14 +19,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
pprint: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
ContentDOMReference: "resource://gre/modules/ContentDOMReference.jsm", ContentDOMReference: "resource://gre/modules/ContentDOMReference.jsm",
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
atom: "chrome://remote/content/marionette/atom.js", atom: "chrome://remote/content/marionette/atom.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
PollPromise: "chrome://remote/content/marionette/sync.js", PollPromise: "chrome://remote/content/marionette/sync.js",
pprint: "chrome://remote/content/shared/Format.jsm",
}); });
const ORDERED_NODE_ITERATOR_TYPE = 5; const ORDERED_NODE_ITERATOR_TYPE = 5;

View file

@ -15,10 +15,13 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
WebReference: "chrome://remote/content/marionette/element.js", WebReference: "chrome://remote/content/marionette/element.js",
}); });

View file

@ -13,8 +13,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
keyData: "chrome://remote/content/shared/webdriver/KeyData.jsm", keyData: "chrome://remote/content/shared/webdriver/KeyData.sys.mjs",
}); });
/** Provides functionality for creating and sending DOM events. */ /** Provides functionality for creating and sending DOM events. */

View file

@ -14,14 +14,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
pprint: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
accessibility: "chrome://remote/content/marionette/accessibility.js", accessibility: "chrome://remote/content/marionette/accessibility.js",
atom: "chrome://remote/content/marionette/atom.js", atom: "chrome://remote/content/marionette/atom.js",
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
event: "chrome://remote/content/marionette/event.js", event: "chrome://remote/content/marionette/event.js",
Log: "chrome://remote/content/shared/Log.jsm",
pprint: "chrome://remote/content/shared/Format.jsm",
TimedPromise: "chrome://remote/content/marionette/sync.js", TimedPromise: "chrome://remote/content/marionette/sync.js",
}); });

View file

@ -23,8 +23,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "domParser", () => { XPCOMUtils.defineLazyGetter(lazy, "domParser", () => {

View file

@ -14,15 +14,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.jsm", Preferences: "resource://gre/modules/Preferences.jsm",
accessibility: "chrome://remote/content/marionette/accessibility.js", accessibility: "chrome://remote/content/marionette/accessibility.js",
element: "chrome://remote/content/marionette/element.js", element: "chrome://remote/content/marionette/element.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
evaluate: "chrome://remote/content/marionette/evaluate.js", evaluate: "chrome://remote/content/marionette/evaluate.js",
event: "chrome://remote/content/marionette/event.js", event: "chrome://remote/content/marionette/event.js",
Log: "chrome://remote/content/shared/Log.jsm",
WebReference: "chrome://remote/content/marionette/element.js", WebReference: "chrome://remote/content/marionette/element.js",
}); });

View file

@ -6,16 +6,12 @@
const EXPORTED_SYMBOLS = ["Command", "Message", "Response"]; const EXPORTED_SYMBOLS = ["Command", "Message", "Response"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.jsm", assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
truncate: "chrome://remote/content/shared/Format.jsm", truncate: "chrome://remote/content/shared/Format.sys.mjs",
}); });
/** Representation of the packets transproted over the wire. */ /** Representation of the packets transproted over the wire. */

View file

@ -12,10 +12,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.jsm", AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -12,16 +12,20 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
PageLoadStrategy:
"chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
ProgressListener: "chrome://remote/content/shared/Navigate.sys.mjs",
truncate: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
EventDispatcher: EventDispatcher:
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm", "chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
modal: "chrome://remote/content/marionette/modal.js", modal: "chrome://remote/content/marionette/modal.js",
PageLoadStrategy: "chrome://remote/content/shared/webdriver/Capabilities.jsm",
ProgressListener: "chrome://remote/content/shared/Navigate.jsm",
TimedPromise: "chrome://remote/content/marionette/sync.js", TimedPromise: "chrome://remote/content/marionette/sync.js",
truncate: "chrome://remote/content/shared/Format.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -12,8 +12,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
MarionettePrefs: "chrome://remote/content/marionette/prefs.js", MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
}); });

View file

@ -12,16 +12,19 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
print: "chrome://remote/content/shared/PDF.sys.mjs",
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
E10SUtils: "resource://gre/modules/E10SUtils.jsm", E10SUtils: "resource://gre/modules/E10SUtils.jsm",
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
capture: "chrome://remote/content/marionette/capture.js", capture: "chrome://remote/content/marionette/capture.js",
Log: "chrome://remote/content/shared/Log.jsm",
navigate: "chrome://remote/content/marionette/navigate.js", navigate: "chrome://remote/content/marionette/navigate.js",
print: "chrome://remote/content/shared/PDF.jsm",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -12,13 +12,16 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
Command: "chrome://remote/content/marionette/message.js", Command: "chrome://remote/content/marionette/message.js",
DebuggerTransport: "chrome://remote/content/marionette/transport.js", DebuggerTransport: "chrome://remote/content/marionette/transport.js",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
GeckoDriver: "chrome://remote/content/marionette/driver.js", GeckoDriver: "chrome://remote/content/marionette/driver.js",
Log: "chrome://remote/content/shared/Log.jsm",
MarionettePrefs: "chrome://remote/content/marionette/prefs.js", MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
Message: "chrome://remote/content/marionette/message.js", Message: "chrome://remote/content/marionette/message.js",
Response: "chrome://remote/content/marionette/message.js", Response: "chrome://remote/content/marionette/message.js",

View file

@ -25,9 +25,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>

View file

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
const { error } = ChromeUtils.import( const { error } = ChromeUtils.importESModule(
"chrome://remote/content/shared/webdriver/Errors.jsm" "chrome://remote/content/shared/webdriver/Errors.sys.mjs"
); );
const { Command, Message, Response } = ChromeUtils.import( const { Command, Message, Response } = ChromeUtils.import(
"chrome://remote/content/marionette/message.js" "chrome://remote/content/marionette/message.js"

View file

@ -16,9 +16,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
executeSoon: "chrome://remote/content/shared/Sync.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm", RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
}); });

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["AppInfo"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const ID_FIREFOX = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; const ID_FIREFOX = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}"; const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
@ -27,7 +21,7 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
* *
* @since 88 * @since 88
*/ */
const AppInfo = new Proxy( export const AppInfo = new Proxy(
{}, {},
{ {
get(target, prop, receiver) { get(target, prop, receiver) {

View file

@ -2,18 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["pprint", "truncate"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -44,7 +38,7 @@ const MAX_STRING_LENGTH = 250;
* pprint`Current window: ${window}`; * pprint`Current window: ${window}`;
* => '[object Window https://www.mozilla.org/]' * => '[object Window https://www.mozilla.org/]'
*/ */
function pprint(ss, ...values) { export function pprint(ss, ...values) {
function pretty(val) { function pretty(val) {
let proto = Object.prototype.toString.call(val); let proto = Object.prototype.toString.call(val);
if ( if (
@ -136,7 +130,7 @@ function pprint(ss, ...values) {
* *
* Functions named `toJSON` or `toString` on objects will be called. * Functions named `toJSON` or `toString` on objects will be called.
*/ */
function truncate(strings, ...values) { export function truncate(strings, ...values) {
function walk(obj) { function walk(obj) {
const typ = Object.prototype.toString.call(obj); const typ = Object.prototype.toString.call(obj);

View file

@ -2,16 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["Log"]; const { Log: StdLog } = ChromeUtils.import("resource://gre/modules/Log.jsm");
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { Log: StdLog } = ChromeUtils.importESModule(
"resource://gre/modules/Log.sys.mjs"
);
const PREF_REMOTE_LOG_LEVEL = "remote.log.level"; const PREF_REMOTE_LOG_LEVEL = "remote.log.level";
@ -42,7 +35,7 @@ XPCOMUtils.defineLazyGetter(lazy, "prefLogLevel", () => {
}); });
/** E10s compatible wrapper for the standard logger from Log.jsm. */ /** E10s compatible wrapper for the standard logger from Log.jsm. */
class Log { export class Log {
static TYPES = { static TYPES = {
CDP: "CDP", CDP: "CDP",
MARIONETTE: "Marionette", MARIONETTE: "Marionette",

View file

@ -2,24 +2,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["MobileTabBrowser"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
GeckoViewTabUtil: "resource://gre/modules/GeckoViewTestUtils.jsm", GeckoViewTabUtil: "resource://gre/modules/GeckoViewTestUtils.jsm",
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
}); });
// GeckoView shim for Desktop's gBrowser // GeckoView shim for Desktop's gBrowser
class MobileTabBrowser { export class MobileTabBrowser {
constructor(window) { constructor(window) {
this.window = window; this.window = window;
} }

View file

@ -2,29 +2,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = [
"ProgressListener",
"waitForInitialNavigationCompleted",
];
const { AppConstants } = ChromeUtils.import( const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm" "resource://gre/modules/AppConstants.jsm"
); );
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
truncate: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
clearTimeout: "resource://gre/modules/Timer.jsm", clearTimeout: "resource://gre/modules/Timer.jsm",
setTimeout: "resource://gre/modules/Timer.jsm", setTimeout: "resource://gre/modules/Timer.jsm",
Deferred: "chrome://remote/content/shared/Sync.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
truncate: "chrome://remote/content/shared/Format.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
@ -69,7 +63,10 @@ const webProgressListeners = new Set();
* - {nsIURI} currentURI The current URI of the page * - {nsIURI} currentURI The current URI of the page
* - {nsIURI} targetURI Target URI of the navigation * - {nsIURI} targetURI Target URI of the navigation
*/ */
async function waitForInitialNavigationCompleted(webProgress, options = {}) { export async function waitForInitialNavigationCompleted(
webProgress,
options = {}
) {
const { resolveWhenStarted = false } = options; const { resolveWhenStarted = false } = options;
const browsingContext = webProgress.browsingContext; const browsingContext = webProgress.browsingContext;
@ -110,7 +107,7 @@ async function waitForInitialNavigationCompleted(webProgress, options = {}) {
/** /**
* WebProgressListener to observe for page loads. * WebProgressListener to observe for page loads.
*/ */
class ProgressListener { export class ProgressListener {
#expectNavigation; #expectNavigation;
#resolveWhenStarted; #resolveWhenStarted;
#unloadTimeout; #unloadTimeout;

View file

@ -2,27 +2,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["print"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
clearInterval: "resource://gre/modules/Timer.jsm", clearInterval: "resource://gre/modules/Timer.jsm",
setInterval: "resource://gre/modules/Timer.jsm", setInterval: "resource://gre/modules/Timer.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
const print = { export const print = {
maxScaleValue: 2.0, maxScaleValue: 2.0,
minScaleValue: 0.1, minScaleValue: 0.1,
letterPaperSizeCm: { letterPaperSizeCm: {

View file

@ -2,20 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["RecommendedPreferences"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.jsm", Preferences: "resource://gre/modules/Preferences.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
@ -271,7 +267,7 @@ const COMMON_PREFERENCES = new Map([
["browser.topsites.contile.enabled", false], ["browser.topsites.contile.enabled", false],
]); ]);
const RecommendedPreferences = { export const RecommendedPreferences = {
alteredPrefs: new Set(), alteredPrefs: new Set(),
isInitialized: false, isInitialized: false,

View file

@ -2,14 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const EXPORTED_SYMBOLS = ["RemoteError"];
/** /**
* Base class for all remote protocol errors. * Base class for all remote protocol errors.
*/ */
class RemoteError extends Error { export class RemoteError extends Error {
get isRemoteError() { get isRemoteError() {
return true; return true;
} }

View file

@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const EXPORTED_SYMBOLS = ["getFramesFromStack", "isChromeFrame"];
/** /**
* An object that contains details of a stack frame. * An object that contains details of a stack frame.
* *
@ -36,7 +32,7 @@ const EXPORTED_SYMBOLS = ["getFramesFromStack", "isChromeFrame"];
* *
* @returns {Array<StackFrame>=} * @returns {Array<StackFrame>=}
*/ */
function getFramesFromStack(stack) { export function getFramesFromStack(stack) {
if (!stack || (Cu && Cu.isDeadWrapper(stack))) { if (!stack || (Cu && Cu.isDeadWrapper(stack))) {
// If the global from which this error came from has been nuked, // If the global from which this error came from has been nuked,
// stack is going to be a dead wrapper. // stack is going to be a dead wrapper.
@ -69,7 +65,7 @@ function getFramesFromStack(stack) {
* @returns {boolean} * @returns {boolean}
* True, if frame is from chrome scope * True, if frame is from chrome scope
*/ */
function isChromeFrame(frame) { export function isChromeFrame(frame) {
return ( return (
frame.filename.startsWith("chrome://") || frame.filename.startsWith("chrome://") ||
frame.filename.startsWith("resource://") frame.filename.startsWith("resource://")

View file

@ -2,25 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = [
"AnimationFramePromise",
"Deferred",
"EventPromise",
"executeSoon",
"PollPromise",
];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
const { TYPE_ONE_SHOT, TYPE_REPEATING_SLACK } = Ci.nsITimer; const { TYPE_ONE_SHOT, TYPE_REPEATING_SLACK } = Ci.nsITimer;
@ -37,7 +25,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
* *
* @return {Promise} * @return {Promise}
*/ */
function AnimationFramePromise(win) { export function AnimationFramePromise(win) {
const animationFramePromise = new Promise(resolve => { const animationFramePromise = new Promise(resolve => {
win.requestAnimationFrame(resolve); win.requestAnimationFrame(resolve);
}); });
@ -64,7 +52,7 @@ function AnimationFramePromise(win) {
* - rejected Flag that indicates that the promise got rejected * - rejected Flag that indicates that the promise got rejected
* - resolve Callback to resolve the promise * - resolve Callback to resolve the promise
*/ */
function Deferred() { export function Deferred() {
const deferred = {}; const deferred = {};
deferred.promise = new Promise((resolve, reject) => { deferred.promise = new Promise((resolve, reject) => {
@ -133,7 +121,7 @@ function Deferred() {
* @throws {TypeError} * @throws {TypeError}
* @throws {RangeError} * @throws {RangeError}
*/ */
function EventPromise(subject, eventName, options = {}) { export function EventPromise(subject, eventName, options = {}) {
const { const {
capture = false, capture = false,
checkFn = null, checkFn = null,
@ -210,7 +198,7 @@ function EventPromise(subject, eventName, options = {}) {
* @param {function} fn * @param {function} fn
* Function to be executed. * Function to be executed.
*/ */
function executeSoon(fn) { export function executeSoon(fn) {
if (typeof fn != "function") { if (typeof fn != "function") {
throw new TypeError(); throw new TypeError();
} }
@ -269,7 +257,7 @@ function executeSoon(fn) {
* @throws {RangeError} * @throws {RangeError}
* If `timeout` or `interval` are not unsigned integers. * If `timeout` or `interval` are not unsigned integers.
*/ */
function PollPromise(func, { timeout = null, interval = 10 } = {}) { export function PollPromise(func, { timeout = null, interval = 10 } = {}) {
const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
if (typeof func != "function") { if (typeof func != "function") {

View file

@ -2,26 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["TabManager"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.jsm", AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
EventPromise: "chrome://remote/content/shared/Sync.jsm", EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
MobileTabBrowser: "chrome://remote/content/shared/MobileTabBrowser.jsm", MobileTabBrowser: "chrome://remote/content/shared/MobileTabBrowser.sys.mjs",
}); });
// Maps browser's permanentKey to uuid: WeakMap.<Object, string> // Maps browser's permanentKey to uuid: WeakMap.<Object, string>
const browserUniqueIds = new WeakMap(); const browserUniqueIds = new WeakMap();
var TabManager = { export var TabManager = {
/** /**
* Retrieve all the browser elements from tabs as contained in open windows. * Retrieve all the browser elements from tabs as contained in open windows.
* *

View file

@ -3,25 +3,22 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["WebSocketConnection"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.sys.mjs",
truncate: "chrome://remote/content/shared/Format.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm",
truncate: "chrome://remote/content/shared/Format.jsm",
WebSocketTransport: "chrome://remote/content/server/WebSocketTransport.jsm", WebSocketTransport: "chrome://remote/content/server/WebSocketTransport.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
class WebSocketConnection { export class WebSocketConnection {
/** /**
* @param {WebSocket} webSocket * @param {WebSocket} webSocket
* The WebSocket server connection to wrap. * The WebSocket server connection to wrap.

View file

@ -2,22 +2,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["windowManager"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
TabManager: "chrome://remote/content/shared/TabManager.jsm",
TimedPromise: "chrome://remote/content/marionette/sync.js", TimedPromise: "chrome://remote/content/marionette/sync.js",
EventPromise: "chrome://remote/content/shared/Sync.jsm",
waitForObserverTopic: "chrome://remote/content/marionette/sync.js", waitForObserverTopic: "chrome://remote/content/marionette/sync.js",
}); });
@ -279,4 +276,4 @@ class WindowManager {
} }
// Expose a shared singleton. // Expose a shared singleton.
const windowManager = new WindowManager(); export const windowManager = new WindowManager();

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["BrowsingContextListener"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -46,7 +40,7 @@ const OBSERVER_TOPIC_SET_EMBEDDER = "browsing-context-did-set-embedder";
* Usually "attach" or "discard", but will contain "replace" if the * Usually "attach" or "discard", but will contain "replace" if the
* browsing context gets replaced by a cross-group navigation. * browsing context gets replaced by a cross-group navigation.
*/ */
class BrowsingContextListener { export class BrowsingContextListener {
#listening; #listening;
#topContextsToAttach; #topContextsToAttach;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["ConsoleAPIListener"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -46,7 +40,7 @@ XPCOMUtils.defineLazyGetter(lazy, "ConsoleAPIStorage", () => {
* - {Array<Object>} stacktrace - List of stack frames, starting from most recent. * - {Array<Object>} stacktrace - List of stack frames, starting from most recent.
* - {Number} timeStamp - Timestamp when the method was called. * - {Number} timeStamp - Timestamp when the method was called.
*/ */
class ConsoleAPIListener { export class ConsoleAPIListener {
#emittedMessages; #emittedMessages;
#innerWindowId; #innerWindowId;
#listening; #listening;

View file

@ -2,21 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["ConsoleListener"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
getFramesFromStack: "chrome://remote/content/shared/Stack.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.jsm", EventEmitter: "resource://gre/modules/EventEmitter.jsm",
getFramesFromStack: "chrome://remote/content/shared/Stack.jsm",
Log: "chrome://remote/content/shared/Log.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -51,7 +47,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* starting from most recent. * starting from most recent.
* - {Number} timeStamp - Timestamp when the method was called. * - {Number} timeStamp - Timestamp when the method was called.
*/ */
class ConsoleListener { export class ConsoleListener {
#emittedMessages; #emittedMessages;
#innerWindowId; #innerWindowId;
#listening; #listening;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["LoadListener"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -37,7 +31,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* - {Document} target * - {Document} target
* The target document. * The target document.
*/ */
class LoadListener { export class LoadListener {
#abortController; #abortController;
#window; #window;

View file

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
const { BrowsingContextListener } = ChromeUtils.import( const { BrowsingContextListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/BrowsingContextListener.jsm" "chrome://remote/content/shared/listeners/BrowsingContextListener.sys.mjs"
); );
add_task(async function test_attachedOnNewTab() { add_task(async function test_attachedOnNewTab() {

View file

@ -115,8 +115,8 @@ function listenToConsoleAPIMessage() {
info("Listen to a console api message in content"); info("Listen to a console api message in content");
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => { return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleAPIListener } = ChromeUtils.import( const { ConsoleAPIListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm" "chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
); );
const consoleAPIListener = new ConsoleAPIListener(innerWindowId); const consoleAPIListener = new ConsoleAPIListener(innerWindowId);
const onMessage = consoleAPIListener.once("message"); const onMessage = consoleAPIListener.once("message");

View file

@ -10,8 +10,8 @@ add_task(async function test_cached_messages() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => { await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleAPIListener } = ChromeUtils.import( const { ConsoleAPIListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm" "chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
); );
info("Log two messages before starting the ConsoleAPIListener"); info("Log two messages before starting the ConsoleAPIListener");
@ -67,8 +67,8 @@ add_task(async function test_cached_messages() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => { await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleAPIListener } = ChromeUtils.import( const { ConsoleAPIListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm" "chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
); );
info("Log a message before creating the ConsoleAPIListener"); info("Log a message before creating the ConsoleAPIListener");

View file

@ -100,8 +100,8 @@ function listenToConsoleMessage(level) {
[level], [level],
async _level => { async _level => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleListener } = ChromeUtils.import( const { ConsoleListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleListener.jsm" "chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
); );
const consoleListener = new ConsoleListener(innerWindowId); const consoleListener = new ConsoleListener(innerWindowId);
const onMessage = consoleListener.once(_level); const onMessage = consoleListener.once(_level);

View file

@ -12,8 +12,8 @@ add_task(async function test_cached_javascript_errors() {
await createScriptNode(`(() => {throw "error1"})()`); await createScriptNode(`(() => {throw "error1"})()`);
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => { await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleListener } = ChromeUtils.import( const { ConsoleListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleListener.jsm" "chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
); );
const listener = new ConsoleListener(innerWindowId); const listener = new ConsoleListener(innerWindowId);
@ -58,8 +58,8 @@ add_task(async function test_cached_javascript_errors() {
await createScriptNode(`(() => {throw "error3"})()`); await createScriptNode(`(() => {throw "error3"})()`);
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => { await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const innerWindowId = content.windowGlobalChild.innerWindowId; const innerWindowId = content.windowGlobalChild.innerWindowId;
const { ConsoleListener } = ChromeUtils.import( const { ConsoleListener } = ChromeUtils.importESModule(
"chrome://remote/content/shared/listeners/ConsoleListener.jsm" "chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
); );
const listener = new ConsoleListener(innerWindowId); const listener = new ConsoleListener(innerWindowId);

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { RemoteError } from "chrome://remote/content/shared/RemoteError.sys.mjs";
const EXPORTED_SYMBOLS = ["error"];
const { RemoteError } = ChromeUtils.import(
"chrome://remote/content/shared/RemoteError.jsm"
);
class MessageHandlerError extends RemoteError { class MessageHandlerError extends RemoteError {
/** /**
@ -90,7 +84,7 @@ const STATUSES = new Map([
]); ]);
/** @namespace */ /** @namespace */
const error = { export const error = {
MessageHandlerError, MessageHandlerError,
UnsupportedCommandError, UnsupportedCommandError,
}; };

View file

@ -2,21 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["EventsDispatcher"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
ContextDescriptorType: ContextDescriptorType:
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm", "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.jsm", TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -27,7 +21,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* subscribe and unsubscribe to those events based on SessionData updates * subscribe and unsubscribe to those events based on SessionData updates
* and should use the "event" SessionData category. * and should use the "event" SessionData category.
*/ */
class EventsDispatcher { export class EventsDispatcher {
// The MessageHandler owning this EventsDispatcher. // The MessageHandler owning this EventsDispatcher.
#messageHandler; #messageHandler;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["ContextDescriptorType", "MessageHandler"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { EventEmitter } = ChromeUtils.import( const { EventEmitter } = ChromeUtils.import(
"resource://gre/modules/EventEmitter.jsm" "resource://gre/modules/EventEmitter.jsm"
@ -16,12 +10,13 @@ const { EventEmitter } = ChromeUtils.import(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/messagehandler/Errors.jsm", error: "chrome://remote/content/shared/messagehandler/Errors.sys.mjs",
EventsDispatcher: EventsDispatcher:
"chrome://remote/content/shared/messagehandler/EventsDispatcher.jsm", "chrome://remote/content/shared/messagehandler/EventsDispatcher.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
ModuleCache: "chrome://remote/content/shared/messagehandler/ModuleCache.jsm", ModuleCache:
"chrome://remote/content/shared/messagehandler/ModuleCache.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -45,7 +40,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* *
* @enum {string} * @enum {string}
*/ */
const ContextDescriptorType = { export const ContextDescriptorType = {
All: "All", All: "All",
TopBrowsingContext: "TopBrowsingContext", TopBrowsingContext: "TopBrowsingContext",
}; };
@ -90,7 +85,7 @@ const ContextDescriptorType = {
* instances are properly registered and can be retrieved based on a given * instances are properly registered and can be retrieved based on a given
* session id as well as some other context information. * session id as well as some other context information.
*/ */
class MessageHandler extends EventEmitter { export class MessageHandler extends EventEmitter {
#context; #context;
#contextId; #contextId;
#eventsDispatcher; #eventsDispatcher;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["getMessageHandlerClass", "MessageHandlerRegistry"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { EventEmitter } = ChromeUtils.import( const { EventEmitter } = ChromeUtils.import(
"resource://gre/modules/EventEmitter.jsm" "resource://gre/modules/EventEmitter.jsm"
@ -16,14 +10,14 @@ const { EventEmitter } = ChromeUtils.import(
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
readSessionData: readSessionData:
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.jsm", "chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs",
RootMessageHandler: RootMessageHandler:
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm", "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs",
WindowGlobalMessageHandler: WindowGlobalMessageHandler:
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm", "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -51,7 +45,7 @@ XPCOMUtils.defineLazyGetter(
* @throws {Error} * @throws {Error}
* Throws if no MessageHandler subclass is found for the provided type. * Throws if no MessageHandler subclass is found for the provided type.
*/ */
function getMessageHandlerClass(type) { export function getMessageHandlerClass(type) {
if (!lazy.MessageHandlerClasses.has(type)) { if (!lazy.MessageHandlerClasses.has(type)) {
throw new Error(`No MessageHandler class available for type "${type}"`); throw new Error(`No MessageHandler class available for type "${type}"`);
} }
@ -70,7 +64,7 @@ function getMessageHandlerClass(type) {
* The registry is useful to retrieve the appropriate MessageHandler instance * The registry is useful to retrieve the appropriate MessageHandler instance
* after crossing a technical boundary (eg process, thread...). * after crossing a technical boundary (eg process, thread...).
*/ */
class MessageHandlerRegistry extends EventEmitter { export class MessageHandlerRegistry extends EventEmitter {
/* /*
* @param {String} type * @param {String} type
* MessageHandler type, one of MessageHandler.type. * MessageHandler type, one of MessageHandler.type.

View file

@ -2,27 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["Module"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
ContextDescriptorType: ContextDescriptorType:
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm", "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
error: "chrome://remote/content/shared/webdriver/Errors.jsm", error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "disabledExperimentalAPI", () => { XPCOMUtils.defineLazyGetter(lazy, "disabledExperimentalAPI", () => {
return !Services.prefs.getBoolPref("remote.experimental.enabled"); return !Services.prefs.getBoolPref("remote.experimental.enabled");
}); });
class Module { export class Module {
#messageHandler; #messageHandler;
/** /**

View file

@ -2,20 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["ModuleCache"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
getMessageHandlerClass: getMessageHandlerClass:
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm", "chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
}); });
const protocols = { const protocols = {
@ -29,9 +23,10 @@ XPCOMUtils.defineLazyModuleGetters(protocols.bidi, {
getModuleClass: getModuleClass:
"chrome://remote/content/webdriver-bidi/modules/ModuleRegistry.jsm", "chrome://remote/content/webdriver-bidi/modules/ModuleRegistry.jsm",
}); });
XPCOMUtils.defineLazyModuleGetters(protocols.test, { // eslint-disable-next-line mozilla/lazy-getter-object-name
ChromeUtils.defineESModuleGetters(protocols.test, {
getModuleClass: getModuleClass:
"chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.jsm", "chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@ -67,7 +62,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* the logic detailed above, the MessageHandler will assume that the command * the logic detailed above, the MessageHandler will assume that the command
* should simply be forwarded to the next layer of the network. * should simply be forwarded to the next layer of the network.
*/ */
class ModuleCache { export class ModuleCache {
/* /*
* @param {MessageHandler} messageHandler * @param {MessageHandler} messageHandler
* The MessageHandler instance which owns this ModuleCache instance. * The MessageHandler instance which owns this ModuleCache instance.

View file

@ -2,27 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { MessageHandler } from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
const EXPORTED_SYMBOLS = ["RootMessageHandler"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { MessageHandler } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
FrameTransport: FrameTransport:
"chrome://remote/content/shared/messagehandler/transports/FrameTransport.jsm", "chrome://remote/content/shared/messagehandler/transports/FrameTransport.sys.mjs",
SessionData: SessionData:
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm", "chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs",
WindowGlobalMessageHandler: WindowGlobalMessageHandler:
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm", "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs",
}); });
/** /**
@ -30,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* in the parent process. It can forward commands to MessageHandlers in other * in the parent process. It can forward commands to MessageHandlers in other
* layers (at the moment WindowGlobalMessageHandlers in content processes). * layers (at the moment WindowGlobalMessageHandlers in content processes).
*/ */
class RootMessageHandler extends MessageHandler { export class RootMessageHandler extends MessageHandler {
#frameTransport; #frameTransport;
#sessionData; #sessionData;

View file

@ -2,16 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { MessageHandlerRegistry } from "chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs";
var EXPORTED_SYMBOLS = ["RootMessageHandlerRegistry"]; import { RootMessageHandler } from "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs";
const { MessageHandlerRegistry } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm"
);
const { RootMessageHandler } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
);
/** /**
* In the parent process, only one Root MessageHandlerRegistry should ever be * In the parent process, only one Root MessageHandlerRegistry should ever be
@ -19,6 +12,6 @@ const { RootMessageHandler } = ChromeUtils.import(
* registry and from there either create or retrieve Root MessageHandler * registry and from there either create or retrieve Root MessageHandler
* instances for a specific session. * instances for a specific session.
*/ */
var RootMessageHandlerRegistry = new MessageHandlerRegistry( export var RootMessageHandlerRegistry = new MessageHandlerRegistry(
RootMessageHandler.type RootMessageHandler.type
); );

View file

@ -2,13 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import {
ContextDescriptorType,
const EXPORTED_SYMBOLS = ["WindowGlobalMessageHandler"]; MessageHandler,
} from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
const { ContextDescriptorType, MessageHandler } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
);
/** /**
* A WindowGlobalMessageHandler is dedicated to debugging a single window * A WindowGlobalMessageHandler is dedicated to debugging a single window
@ -17,7 +14,7 @@ const { ContextDescriptorType, MessageHandler } = ChromeUtils.import(
* commands further to other MessageHandlers and represents a leaf node in a * commands further to other MessageHandlers and represents a leaf node in a
* MessageHandler network. * MessageHandler network.
*/ */
class WindowGlobalMessageHandler extends MessageHandler { export class WindowGlobalMessageHandler extends MessageHandler {
#innerWindowId; #innerWindowId;
constructor() { constructor() {

View file

@ -2,27 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["SESSION_DATA_SHARED_DATA_KEY", "SessionData"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
ContextDescriptorType: ContextDescriptorType:
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm", "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
Log: "chrome://remote/content/shared/Log.jsm", Log: "chrome://remote/content/shared/Log.sys.mjs",
RootMessageHandler: RootMessageHandler:
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm", "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
const SESSION_DATA_SHARED_DATA_KEY = "MessageHandlerSessionData"; export const SESSION_DATA_SHARED_DATA_KEY = "MessageHandlerSessionData";
// This is a map from session id to session data, which will be persisted and // This is a map from session id to session data, which will be persisted and
// propagated to all processes using Services' sharedData. // propagated to all processes using Services' sharedData.
@ -86,7 +80,7 @@ const sessionDataMap = new Map();
* SessionDataReader's readSessionData to get read-only access to session data. * SessionDataReader's readSessionData to get read-only access to session data.
* *
*/ */
class SessionData { export class SessionData {
constructor(messageHandler) { constructor(messageHandler) {
if (messageHandler.constructor.type != lazy.RootMessageHandler.type) { if (messageHandler.constructor.type != lazy.RootMessageHandler.type) {
throw new Error( throw new Error(

View file

@ -2,19 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["readSessionData"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
SESSION_DATA_SHARED_DATA_KEY: SESSION_DATA_SHARED_DATA_KEY:
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm", "chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => { XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => {
@ -31,5 +25,5 @@ XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => {
* @return {Map.<string, Array<SessionDataItem>>} * @return {Map.<string, Array<SessionDataItem>>}
* Map of session id to arrays of SessionDataItems. * Map of session id to arrays of SessionDataItems.
*/ */
const readSessionData = () => export const readSessionData = () =>
lazy.sharedData.get(lazy.SESSION_DATA_SHARED_DATA_KEY) || new Map(); lazy.sharedData.get(lazy.SESSION_DATA_SHARED_DATA_KEY) || new Map();

View file

@ -36,8 +36,8 @@ function sendTestBroadcastCommand(
contextDescriptor, contextDescriptor,
rootMessageHandler rootMessageHandler
) { ) {
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
info("Send a test broadcast command"); info("Send a test broadcast command");

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
/** /**

View file

@ -3,14 +3,14 @@
"use strict"; "use strict";
const { RootMessageHandlerRegistry } = ChromeUtils.import( const { RootMessageHandlerRegistry } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs"
); );
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
/** /**

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { isBrowsingContextCompatible } = ChromeUtils.import( const { isBrowsingContextCompatible } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.jsm" "chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.sys.mjs"
); );
const TEST_COM_PAGE = "https://example.com/document-builder.sjs?html=com"; const TEST_COM_PAGE = "https://example.com/document-builder.sjs?html=com";
const TEST_NET_PAGE = "https://example.net/document-builder.sjs?html=net"; const TEST_NET_PAGE = "https://example.net/document-builder.sjs?html=net";
@ -81,8 +81,8 @@ async function checkBrowsingContextCompatible(browser, browserId, expected) {
browser, browser,
[browserId, expected], [browserId, expected],
(_browserId, _expected) => { (_browserId, _expected) => {
const FrameContextUtils = ChromeUtils.import( const FrameContextUtils = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.jsm" "chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.sys.mjs"
); );
is( is(
FrameContextUtils.isBrowsingContextCompatible(content.browsingContext, { FrameContextUtils.isBrowsingContextCompatible(content.browsingContext, {

View file

@ -3,11 +3,11 @@
"use strict"; "use strict";
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
// Check that errors from WindowGlobal modules can be caught by the consumer // Check that errors from WindowGlobal modules can be caught by the consumer

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
// We are forcing the actors to shutdown while queries are unresolved. // We are forcing the actors to shutdown while queries are unresolved.

View file

@ -3,11 +3,11 @@
"use strict"; "use strict";
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
// Test calling methods only implemented in the root version of a module. // Test calling methods only implemented in the root version of a module.

View file

@ -3,11 +3,11 @@
"use strict"; "use strict";
const { MessageHandlerRegistry } = ChromeUtils.import( const { MessageHandlerRegistry } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm" "chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs"
); );
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
add_task(async function test_messageHandlerRegistry_API() { add_task(async function test_messageHandlerRegistry_API() {

View file

@ -3,14 +3,14 @@
"use strict"; "use strict";
const { MessageHandlerRegistry } = ChromeUtils.import( const { MessageHandlerRegistry } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm" "chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs"
); );
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
const { SessionData } = ChromeUtils.import( const { SessionData } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm" "chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs"
); );
const TEST_PAGE = "http://example.com/document-builder.sjs?html=tab"; const TEST_PAGE = "http://example.com/document-builder.sjs?html=tab";
@ -246,8 +246,8 @@ function checkSessionDataItem(item, moduleName, category, contextType, value) {
function getSessionDataFromContent() { function getSessionDataFromContent() {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { return SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
const { readSessionData } = ChromeUtils.import( const { readSessionData } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.jsm" "chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs"
); );
return readSessionData(); return readSessionData();
}); });

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { RootMessageHandler } = ChromeUtils.import( const { RootMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
); );
const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab"; const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab";

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { WindowGlobalMessageHandler } = ChromeUtils.import( const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm" "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
); );
const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab"; const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab";

View file

@ -4,8 +4,8 @@
"use strict"; "use strict";
var { ContextDescriptorType } = ChromeUtils.import( var { ContextDescriptorType } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm" "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs"
); );
var contextDescriptorAll = { var contextDescriptorAll = {
@ -13,8 +13,8 @@ var contextDescriptorAll = {
}; };
function createRootMessageHandler(sessionId) { function createRootMessageHandler(sessionId) {
const { RootMessageHandlerRegistry } = ChromeUtils.import( const { RootMessageHandlerRegistry } = ChromeUtils.importESModule(
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.jsm" "chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs"
); );
return RootMessageHandlerRegistry.getOrCreateMessageHandler(sessionId); return RootMessageHandlerRegistry.getOrCreateMessageHandler(sessionId);
} }

View file

@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["getModuleClass"];
/** /**
* Retrieve the WebDriver BiDi module class matching the provided module name * Retrieve the WebDriver BiDi module class matching the provided module name
* and folder. * and folder.
@ -20,10 +16,11 @@ var EXPORTED_SYMBOLS = ["getModuleClass"];
* @throws {Error} * @throws {Error}
* If the provided module folder is unexpected. * If the provided module folder is unexpected.
**/ **/
const getModuleClass = function(moduleName, moduleFolder) { export const getModuleClass = function(moduleName, moduleFolder) {
const path = `chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/${moduleFolder}/${moduleName}.jsm`; const root = `chrome://mochitests/content/browser/remote/shared/messagehandler/test/`;
const path = `${root}browser/resources/modules/${moduleFolder}/${moduleName}.sys.mjs`;
try { try {
return ChromeUtils.import(path)[moduleName]; return ChromeUtils.importESModule(path)[moduleName];
} catch (e) { } catch (e) {
if (e.result == Cr.NS_ERROR_FILE_NOT_FOUND) { if (e.result == Cr.NS_ERROR_FILE_NOT_FOUND) {
return null; return null;

View file

@ -2,21 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { ContextDescriptorType } from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
const EXPORTED_SYMBOLS = ["command"]; import { WindowGlobalMessageHandler } from "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs";
const { ContextDescriptorType } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
);
const { Module } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/Module.jsm"
);
const { WindowGlobalMessageHandler } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
);
class CommandModule extends Module { class CommandModule extends Module {
destroy() {} destroy() {}
@ -84,4 +72,4 @@ class CommandModule extends Module {
} }
} }
const command = CommandModule; export const command = CommandModule;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
const EXPORTED_SYMBOLS = ["event"];
const { Module } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/Module.jsm"
);
class EventModule extends Module { class EventModule extends Module {
destroy() {} destroy() {}
@ -24,4 +18,4 @@ class EventModule extends Module {
} }
} }
const event = EventModule; export const event = EventModule;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
const EXPORTED_SYMBOLS = ["rootOnly"];
const { Module } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/Module.jsm"
);
class RootOnlyModule extends Module { class RootOnlyModule extends Module {
#sessionDataReceived; #sessionDataReceived;
@ -38,4 +32,4 @@ class RootOnlyModule extends Module {
} }
} }
const rootOnly = RootOnlyModule; export const rootOnly = RootOnlyModule;

View file

@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
const EXPORTED_SYMBOLS = ["command"];
const { Module } = ChromeUtils.import(
"chrome://remote/content/shared/messagehandler/Module.jsm"
);
class CommandModule extends Module { class CommandModule extends Module {
destroy() {} destroy() {}
@ -31,4 +25,4 @@ class CommandModule extends Module {
} }
} }
const command = CommandModule; export const command = CommandModule;

Some files were not shown because too many files have changed in this diff Show more