Skip to content

Commit

Permalink
Bug 1795322 - Update toolkit modules references in marionette related…
Browse files Browse the repository at this point in the history
… code. r=whimboo,webdriver-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D160026
  • Loading branch information
Standard8 committed Oct 26, 2022
1 parent 0227124 commit cce2d7f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion remote/cdp/domains/content/Runtime.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ export class Runtime extends ContentProcessDomain {
}

function fromConsoleAPI(message) {
// From sendConsoleAPIMessage (toolkit/modules/Console.jsm)
// From sendConsoleAPIMessage (toolkit/modules/Console.sys.mjs)
return {
arguments: message.arguments,
innerWindowId: message.innerID,
Expand Down
2 changes: 1 addition & 1 deletion remote/marionette/prefs.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class Branch {
* `LogBranch` specialisation deserialises the string value to the
* correct `Log.Level` by sanitising the input data first.
*
* A further complication is that we cannot rely on `Preferences.jsm`
* A further complication is that we cannot rely on `Preferences.sys.mjs`
* in Marionette. See https://bugzilla.mozilla.org/show_bug.cgi?id=1357517
* for further details.
*/
Expand Down
4 changes: 2 additions & 2 deletions remote/shared/Log.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ XPCOMUtils.defineLazyGetter(lazy, "prefLogLevel", () => {
return PREF_REMOTE_LOG_LEVEL;
});

/** E10s compatible wrapper for the standard logger from Log.jsm. */
/** E10s compatible wrapper for the standard logger from Log.sys.mjs. */
export class Log {
static TYPES = {
CDP: "CDP",
Expand Down Expand Up @@ -71,7 +71,7 @@ export class Log {
}

static get verbose() {
// we can't use Preferences.jsm before first paint,
// we can't use Preferences.sys.mjs before first paint,
// see ../browser/base/content/test/performance/browser_startup.js
const level = Services.prefs.getStringPref(PREF_REMOTE_LOG_LEVEL, "Info");
return StdLog.Level[level] >= StdLog.Level.Info;
Expand Down
12 changes: 6 additions & 6 deletions testing/marionette/client/marionette_driver/marionette.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ def clear_pref(self, pref):
with self.using_context(self.CONTEXT_CHROME):
self.execute_script(
"""
const { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
const { Preferences } = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
);
Preferences.reset(arguments[0]);
""",
Expand All @@ -796,8 +796,8 @@ def get_pref(self, pref, default_branch=False, value_type="unspecified"):
with self.using_context(self.CONTEXT_CHROME):
pref_value = self.execute_script(
"""
const { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
const { Preferences } = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
);
let pref = arguments[0];
Expand Down Expand Up @@ -835,8 +835,8 @@ def set_pref(self, pref, value, default_branch=False):

self.execute_script(
"""
const { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
const { Preferences } = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
);
let pref = arguments[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, marionette):
with self.marionette.using_context("chrome"):
self.crash_reporter_enabled = self.marionette.execute_script(
"""
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
return AppConstants.MOZ_CRASHREPORTER;
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def is_remote_tab(self):
# TODO: DO NOT USE MOST RECENT WINDOW BUT CURRENT ONE
return self.marionette.execute_script(
"""
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
let win = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def tearDown(self):
with self.marionette.using_context("chrome"):
self.marionette.execute_script(
"""
const { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
const { Preferences } = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
);
Preferences.resetBranch("network.proxy");
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def get_selected_tab_index(self):
with self.marionette.using_context("chrome"):
return self.marionette.execute_script(
"""
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
let win = null;
Expand Down

0 comments on commit cce2d7f

Please sign in to comment.