mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 1667455 - Part 13: Stop importing Services.jsm from marionette tests. r=kmag,webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D150902
This commit is contained in:
parent
1a709a296a
commit
a04d47efb9
@ -75,9 +75,6 @@ class TestSafeBrowsingNotificationBar(WindowManagerMixin, MarionetteTestCase):
|
||||
with self.marionette.using_context("chrome"):
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
let uri = Services.io.newURI(arguments[0], null, null);
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {});
|
||||
Services.perms.removeFromPrincipal(principal, arguments[1]);
|
||||
|
@ -78,9 +78,6 @@ class TestSafeBrowsingWarningPages(WindowManagerMixin, MarionetteTestCase):
|
||||
with self.marionette.using_context("chrome"):
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
let uri = Services.io.newURI(arguments[0], null, null);
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {});
|
||||
Services.perms.removeFromPrincipal(principal, arguments[1]);
|
||||
@ -101,9 +98,6 @@ class TestSafeBrowsingWarningPages(WindowManagerMixin, MarionetteTestCase):
|
||||
with self.marionette.using_context("chrome"):
|
||||
url = self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
return Services.urlFormatter.formatURLPref("app.support.baseURL")
|
||||
+ "phishing-malware";
|
||||
"""
|
||||
|
@ -96,9 +96,6 @@ class WindowManagerMixin(object):
|
||||
with self.marionette.using_context("chrome"):
|
||||
return self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
const { windowManager } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/WindowManager.jsm"
|
||||
);
|
||||
|
@ -55,8 +55,6 @@ class TestModalDialogs(WindowManagerMixin, MarionetteTestCase):
|
||||
with self.marionette.using_context("chrome"):
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const [ modalType, browsingContextId, delay ] = arguments;
|
||||
|
||||
const modalTypes = {
|
||||
|
@ -85,9 +85,6 @@ class BaseNavigationTestCase(WindowManagerMixin, MarionetteTestCase):
|
||||
let win = null;
|
||||
|
||||
if (AppConstants.MOZ_APP_NAME == "fennec") {
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
} else {
|
||||
const { BrowserWindowTracker } = ChromeUtils.import(
|
||||
|
@ -114,9 +114,6 @@ class TestQuitRestart(MarionetteTestCase):
|
||||
with self.marionette.using_context("chrome"):
|
||||
return self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
return Services.appinfo.inSafeMode;
|
||||
"""
|
||||
)
|
||||
@ -125,9 +122,6 @@ class TestQuitRestart(MarionetteTestCase):
|
||||
self.marionette.set_context("chrome")
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
let flags = Ci.nsIAppStartup.eAttemptQuit;
|
||||
if (arguments[0]) {
|
||||
flags |= Ci.nsIAppStartup.eRestart;
|
||||
|
@ -49,9 +49,6 @@ class TestSwitchToWindowContent(WindowManagerMixin, MarionetteTestCase):
|
||||
let win = null;
|
||||
|
||||
if (AppConstants.MOZ_APP_NAME == "fennec") {
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
} else {
|
||||
const { BrowserWindowTracker } = ChromeUtils.import(
|
||||
|
@ -267,9 +267,6 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
||||
driver.set_context("chrome")
|
||||
driver.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
@ -278,9 +275,6 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
||||
)
|
||||
driver.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit)
|
||||
"""
|
||||
)
|
||||
|
@ -28,7 +28,6 @@ SIMPLE_PASSING_TEST = "function run_test() { Assert.ok(true); }"
|
||||
SIMPLE_FAILING_TEST = "function run_test() { Assert.ok(false); }"
|
||||
SIMPLE_PREFCHECK_TEST = """
|
||||
function run_test() {
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Assert.ok(Services.prefs.getBoolPref("fake.pref.to.test"));
|
||||
}
|
||||
"""
|
||||
|
@ -110,9 +110,6 @@ class Browser(object):
|
||||
"""
|
||||
|
||||
script = """\
|
||||
let { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", true);
|
||||
"""
|
||||
|
||||
|
@ -38,7 +38,6 @@ class TestDeletionRequestPing(FOGTestCase):
|
||||
|
||||
debug_tag = "my-test-tag"
|
||||
tagging_script = """\
|
||||
const {{ Services }} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Services.fog.setTagPings("{}");
|
||||
""".format(
|
||||
debug_tag
|
||||
|
@ -8,7 +8,6 @@ class TestFissionAutostart(MarionetteTestCase):
|
||||
def call_quit():
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit);
|
||||
""",
|
||||
sandbox="system",
|
||||
@ -23,7 +22,6 @@ class TestFissionAutostart(MarionetteTestCase):
|
||||
def call_quit():
|
||||
self.marionette.execute_script(
|
||||
"""
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit, 5);
|
||||
""",
|
||||
sandbox="system",
|
||||
|
@ -133,8 +133,6 @@ class TestFissionAutostart(MarionetteTestCase):
|
||||
// We're running in a function, in a sandbox, that inherits from an
|
||||
// X-ray wrapped window. Anything we want to be globally available
|
||||
// needs to be defined on that window.
|
||||
let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
window.Services = Services;
|
||||
window.env = Cc["@mozilla.org/process/environment;1"]
|
||||
.getService(Ci.nsIEnvironment);
|
||||
"""
|
||||
|
@ -141,8 +141,6 @@ class TestWin32kAutostart(MarionetteTestCase):
|
||||
// We're running in a function, in a sandbox, that inherits from an
|
||||
// X-ray wrapped window. Anything we want to be globally available
|
||||
// needs to be defined on that window.
|
||||
let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
window.Services = Services;
|
||||
window.env = Cc["@mozilla.org/process/environment;1"]
|
||||
.getService(Ci.nsIEnvironment);
|
||||
"""
|
||||
|
@ -141,8 +141,6 @@ class TestWin32kAutostart(MarionetteTestCase):
|
||||
// We're running in a function, in a sandbox, that inherits from an
|
||||
// X-ray wrapped window. Anything we want to be globally available
|
||||
// needs to be defined on that window.
|
||||
let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
window.Services = Services;
|
||||
window.env = Cc["@mozilla.org/process/environment;1"]
|
||||
.getService(Ci.nsIEnvironment);
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user