Bug 1245530 - Use require(Services) instead of Cu.import(Services.jsm). r=jryans

This commit is contained in:
Alexandre Poirot 2016-02-27 04:51:10 -08:00
parent 14dd7d7c35
commit 1e96ba50cf
131 changed files with 178 additions and 201 deletions

View File

@ -5,7 +5,6 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
@ -13,6 +12,7 @@ Cu.import("resource://gre/modules/Console.jsm");
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
const Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
const { CallWatcherFront } = require("devtools/server/actors/call-watcher");
const { CanvasFront } = require("devtools/server/actors/canvas");

View File

@ -4,17 +4,11 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
// Disable logging for all the tests. Both the debugger server and frontend will
// be affected by this pref.
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
Services.prefs.setBoolPref("devtools.debugger.log", false);
var { generateUUID } = Cc['@mozilla.org/uuid-generator;1'].getService(Ci.nsIUUIDGenerator);
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
var { gDevTools } = require("devtools/client/framework/devtools");
var { DebuggerClient } = require("devtools/shared/client/main");
@ -43,6 +37,11 @@ const WEBGL_DRAW_ARRAYS = EXAMPLE_URL + "doc_webgl-drawArrays.html";
const WEBGL_DRAW_ELEMENTS = EXAMPLE_URL + "doc_webgl-drawElements.html";
const RAF_BEGIN_URL = EXAMPLE_URL + "doc_raf-begin.html";
// Disable logging for all the tests. Both the debugger server and frontend will
// be affected by this pref.
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
Services.prefs.setBoolPref("devtools.debugger.log", false);
// All tests are asynchronous.
waitForExplicitFinish();

View File

@ -93,7 +93,6 @@ const FRAME_TYPE = {
PUBLIC_CLIENT_EVAL: 3
};
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/shared/event-emitter.js");
Cu.import("resource://devtools/client/shared/widgets/SimpleListWidget.jsm");
@ -137,6 +136,7 @@ var services = {
WAIT_UNTIL: waitUntilService.NAME
};
var Services = require("Services");
var {TargetFactory} = require("devtools/client/framework/target");
var {Toolbox} = require("devtools/client/framework/toolbox");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -5,8 +5,7 @@
"use strict";
const {Cc, Ci} = require("chrome");
const { Services } = require("resource://gre/modules/Services.jsm");
const Services = require("Services");
loader.lazyGetter(this, "osString", () => Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS);

View File

@ -7,10 +7,9 @@ const {rgbToHsl} = require("devtools/shared/css-color").colorUtils;
const Telemetry = require("devtools/client/shared/telemetry");
const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js");
const promise = require("promise");
const Services = require("Services");
const {setTimeout, clearTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
Cu.import("resource://gre/modules/Services.jsm");
loader.lazyGetter(this, "clipboardHelper", function() {
return Cc["@mozilla.org/widget/clipboardhelper;1"]
.getService(Ci.nsIClipboardHelper);

View File

@ -11,7 +11,6 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
const DBG_XUL = "chrome://devtools/content/framework/toolbox-process-window.xul";
const CHROME_DEBUGGER_PROFILE_NAME = "chrome_debugger_profile";
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm")
const { require, DevToolsLoader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
@ -22,6 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "EventEmitter", function () {
return require("devtools/shared/event-emitter");
});
const promise = require("promise");
const Services = require("Services");
this.EXPORTED_SYMBOLS = ["BrowserToolboxProcess"];

View File

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const {Cc, Ci, Cu} = require("chrome");
const Services = Cu.import("resource://gre/modules/Services.jsm", {}).Services;
const Services = require("Services");
const promise = require("promise");
function l10n(name) {

View File

@ -8,9 +8,9 @@
var Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var {gDevTools} = require("devtools/client/framework/devtools");
var {TargetFactory} = require("devtools/client/framework/target");
var {Toolbox} = require("devtools/client/framework/toolbox")

View File

@ -7,9 +7,9 @@
const {Cu} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
var Services = require("Services");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");

View File

@ -17,7 +17,6 @@ function scopedCuImport(path) {
return scope;
}
const {Services} = scopedCuImport("resource://gre/modules/Services.jsm");
const {console} = scopedCuImport("resource://gre/modules/Console.jsm");
const {ScratchpadManager} = scopedCuImport("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
const {require} = scopedCuImport("resource://devtools/shared/Loader.jsm");
@ -26,6 +25,7 @@ const {gDevTools} = require("devtools/client/framework/devtools");
const {TargetFactory} = require("devtools/client/framework/target");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
let promise = require("promise");
const Services = require("Services");
const TEST_DIR = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
const CHROME_URL_ROOT = TEST_DIR + "/";

View File

@ -9,7 +9,7 @@
const {Cu} = require("chrome");
const EventEmitter = require("devtools/shared/event-emitter");
const promise = require("promise");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
loader.lazyRequireGetter(this, "system", "devtools/shared/system");

View File

@ -16,7 +16,7 @@ require("devtools/client/framework/devtools-browser");
var { gDevTools } = require("devtools/client/framework/devtools");
var { TargetFactory } = require("devtools/client/framework/target");
var { Toolbox } = require("devtools/client/framework/toolbox");
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var Services = require("Services");
var { DebuggerClient } = require("devtools/shared/client/main");
var { ViewHelpers } =
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});

View File

@ -18,6 +18,7 @@ const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER";
var {Cc, Ci, Cu} = require("chrome");
var promise = require("promise");
var Services = require("Services");
var {gDevTools} = require("devtools/client/framework/devtools");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");
@ -25,7 +26,6 @@ var HUDService = require("devtools/client/webconsole/hudservice");
var viewSource = require("devtools/client/shared/view-source");
var { attachThread, detachThread } = require("./attach-thread");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
Cu.import("resource://gre/modules/Task.jsm");

View File

@ -8,7 +8,7 @@
const {Cu, Ci} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const promise = require("promise");
const ENSURE_SELECTION_VISIBLE_DELAY = 50; // ms

View File

@ -14,6 +14,7 @@ const ToolDefinitions = require("devtools/client/main").Tools;
const {CssLogic} = require("devtools/shared/inspector/css-logic");
const {ELEMENT_STYLE} = require("devtools/server/actors/styles");
const promise = require("promise");
const Services = require("Services");
const {setTimeout, clearTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
const {OutputParser} = require("devtools/client/shared/output-parser");
const {PrefObserver, PREF_ORIG_SOURCES} = require("devtools/client/styleeditor/utils");
@ -25,7 +26,6 @@ loader.lazyRequireGetter(this, "overlays",
loader.lazyRequireGetter(this, "StyleInspectorMenu",
"devtools/client/inspector/shared/style-inspector-menu");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",

View File

@ -8,8 +8,7 @@
const {Cc, Ci, Cu} = require("chrome");
Cu.import("resource://gre/modules/Services.jsm");
var Services = require("Services");
var promise = require("promise");
var EventEmitter = require("devtools/shared/event-emitter");
var clipboard = require("sdk/clipboard");

View File

@ -6,7 +6,7 @@
const {Cu} = require("chrome");
const Editor = require("devtools/client/sourceeditor/editor");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
Cu.import("resource://devtools/shared/event-emitter.js");
/**

View File

@ -42,7 +42,6 @@ const {scrollIntoViewIfNeeded} = require("devtools/shared/layout/utils");
const {PrefObserver} = require("devtools/client/styleeditor/utils");
Cu.import("resource://devtools/shared/gcli/Templater.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
loader.lazyRequireGetter(this, "CSS", "CSS");

View File

@ -13,8 +13,6 @@ const {promiseWarn} = require("devtools/client/inspector/shared/utils");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
loader.lazyGetter(this, "PSEUDO_ELEMENTS", () => {
return domUtils.getCSSPseudoElementNames();
});

View File

@ -9,6 +9,7 @@
const {Cc, Ci, Cu} = require("chrome");
const promise = require("promise");
const Services = require("Services");
const {Tools} = require("devtools/client/main");
const {setTimeout, clearTimeout} =
Cu.import("resource://gre/modules/Timer.jsm", {});
@ -34,7 +35,6 @@ loader.lazyRequireGetter(this, "EventEmitter",
"devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "StyleInspectorMenu",
"devtools/client/inspector/shared/style-inspector-menu");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyGetter(this, "clipboardHelper", function() {
return Cc["@mozilla.org/widget/clipboardhelper;1"]

View File

@ -8,10 +8,10 @@
"use strict";
const {PREF_ORIG_SOURCES} = require("devtools/client/styleeditor/utils");
const Services = require("Services");
loader.lazyRequireGetter(this, "overlays",
"devtools/client/inspector/shared/style-inspector-overlays");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
loader.lazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
loader.lazyGetter(this, "_strings", () => {

View File

@ -23,7 +23,7 @@ const {
const EventEmitter = require("devtools/shared/event-emitter");
const promise = require("promise");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const PREF_IMAGE_TOOLTIP_SIZE = "devtools.inspector.imagePreviewTooltipSize";

View File

@ -7,6 +7,7 @@
"use strict";
const {Cu, Cc, Ci, components} = require("chrome");
const Services = require("Services");
const {Class} = require("sdk/core/heritage");
const {Unknown} = require("sdk/platform/xpcom");
const xpcom = require("sdk/platform/xpcom");
@ -18,7 +19,6 @@ loader.lazyRequireGetter(this, "NetworkHelper",
loader.lazyRequireGetter(this, "JsonViewUtils",
"devtools/client/jsonview/utils");
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const childProcessMessageManager =
Cc["@mozilla.org/childprocessmessagemanager;1"].

View File

@ -7,9 +7,9 @@
"use strict";
const {Cu, Ci, Cc} = require("chrome");
const Services = require("Services");
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
XPCOMUtils.defineLazyGetter(this, "JsonViewService", function() {
return require("devtools/client/jsonview/utils");

View File

@ -4,8 +4,7 @@
"use strict";
const { Cu } = require("chrome");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const { gDevTools } = require("devtools/client/framework/devtools");
const { defaultTools, defaultThemes } = require("devtools/client/definitions");

View File

@ -6,10 +6,10 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://testing-common/Assert.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://devtools/client/shared/browser-loader.js");
var { require } = BrowserLoader("resource://devtools/client/memory/", this);
var Services = require("Services");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
DevToolsUtils.testing = true;

View File

@ -4,10 +4,10 @@
"use strict";
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { console } = Cu.import("resource://gre/modules/Console.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
DevToolsUtils.testing = true;
DevToolsUtils.dumpn.wantLogging = true;

View File

@ -6,7 +6,7 @@
const { Cu, Ci, Cc } = require("chrome");
const { Class } = require("sdk/core/heritage");
const { defer, resolve } = require("promise");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
Cu.import("resource://gre/modules/Task.jsm");

View File

@ -5,7 +5,7 @@
const { Cu, Ci, Cc } = require("chrome");
const { defer, all, resolve } = require("promise");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
loader.lazyImporter(this, "ViewHelpers", "resource://devtools/client/shared/widgets/ViewHelpers.jsm");
loader.lazyRequireGetter(this, "NetworkHelper", "devtools/shared/webconsole/network-helper");

View File

@ -7,8 +7,7 @@ const { Cu, Ci, Cc } = require("chrome");
const { defer, all } = require("promise");
const { setTimeout, clearTimeout } = require("sdk/timers");
const { makeInfallible } = require("devtools/shared/DevToolsUtils");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
// Helper tracer. Should be generic sharable by other modules (bug 1171927)
const trace = {

View File

@ -4,7 +4,7 @@
"use strict";
const { Cu, Cc, Ci } = require("chrome");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const { defer, resolve } = require("promise");
const { HarUtils } = require("./har-utils.js");
const { HarBuilder } = require("./har-builder.js");

View File

@ -4,7 +4,7 @@
"use strict";
const { Cu, Ci, Cc, CC } = require("chrome");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
XPCOMUtils.defineLazyGetter(this, "dirService", function() {
return Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);

View File

@ -110,7 +110,6 @@ const ACTIVITY_TYPE = {
DISABLE_CACHE: 4
};
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
@ -119,6 +118,7 @@ Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
const Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
const Editor = require("devtools/client/sourceeditor/editor");
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");

View File

@ -4,11 +4,11 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var { gDevTools } = require("devtools/client/framework/devtools");
var { CurlUtils } = Cu.import("resource://devtools/client/shared/Curl.jsm", {});
var Services = require("Services");
var promise = require("promise");
var NetworkHelper = require("devtools/shared/webconsole/network-helper");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -4,12 +4,12 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var { gDevTools } = require("devtools/client/framework/devtools");
var { console } = require("resource://gre/modules/Console.jsm");
var Services = require("Services");
var { TargetFactory } = require("devtools/client/framework/target");
var Promise = require("promise");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -5,7 +5,7 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var Services = require("Services");
var { console } = require("resource://gre/modules/Console.jsm");
const RecordingUtils = require("devtools/shared/performance/recording-utils");
const PLATFORM_DATA_PREF = "devtools.performance.ui.show-platform-data";

View File

@ -6,7 +6,7 @@ const promise = require("promise");
var { registerPlugin, Plugin } = require("devtools/client/projecteditor/lib/plugins/core");
const { AppProjectEditor } = require("./app-project-editor");
const OPTION_URL = "chrome://devtools/skin/images/tool-options.svg";
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
var AppManagerRenderer = Class({

View File

@ -18,7 +18,7 @@ const { merge } = require("sdk/util/object");
const promise = require("promise");
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
const { DOMHelpers } = Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
const ITCHPAD_URL = "chrome://devtools/content/projecteditor/chrome/content/projecteditor.xul";
const { confirm } = require("devtools/client/projecteditor/lib/helpers/prompts");

View File

@ -11,9 +11,9 @@ const { emit } = require("sdk/event/core");
const { Store } = require("devtools/client/projecteditor/lib/stores/base");
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
const promise = require("promise");
const Services = require("Services");
const { on, forget } = require("devtools/client/projecteditor/lib/helpers/event");
const { FileResource } = require("devtools/client/projecteditor/lib/stores/resource");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {setTimeout, clearTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
const CHECK_LINKED_DIRECTORY_DELAY = 5000;

View File

@ -14,9 +14,8 @@ const Cu = Components.utils;
const SCRATCHPAD_WINDOW_URL = "chrome://devtools/content/scratchpad/scratchpad.xul";
const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
Cu.import("resource://gre/modules/Services.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const Telemetry = require("devtools/client/shared/telemetry");

View File

@ -52,10 +52,10 @@ const EventEmitter = require("devtools/shared/event-emitter");
const {DevToolsWorker} = require("devtools/shared/worker/worker");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const promise = require("promise");
const Services = require("Services");
const {gDevTools} = require("devtools/client/framework/devtools");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Cu.import("resource://gre/modules/jsdebugger.jsm");

View File

@ -8,7 +8,7 @@ const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const promise = require("promise");

View File

@ -5,7 +5,6 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
@ -14,6 +13,7 @@ Cu.import("resource://gre/modules/Console.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
const Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
const Editor = require("devtools/client/sourceeditor/editor");

View File

@ -4,15 +4,10 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
// To enable logging for try runs, just set the pref to true.
Services.prefs.setBoolPref("devtools.debugger.log", false);
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
var { gDevTools } = require("devtools/client/framework/devtools");
var { DebuggerClient } = require("devtools/shared/client/main");
@ -32,6 +27,10 @@ const MULTIPLE_CONTEXTS_URL = EXAMPLE_URL + "doc_multiple-contexts.html";
const OVERLAPPING_GEOMETRY_CANVAS_URL = EXAMPLE_URL + "doc_overlapping-geometry.html";
const BLENDED_GEOMETRY_CANVAS_URL = EXAMPLE_URL + "doc_blended-geometry.html";
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
// To enable logging for try runs, just set the pref to true.
Services.prefs.setBoolPref("devtools.debugger.log", false);
// All tests are asynchronous.
waitForExplicitFinish();

View File

@ -28,10 +28,10 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
var { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
var { LoadContextInfo } = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
this.EXPORTED_SYMBOLS = ["AppCacheUtils"];

View File

@ -7,8 +7,7 @@
const {Cc, Ci, Cu} = require("chrome");
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
const Services = require("Services");
const {gDevTools} = require("devtools/client/framework/devtools");
const events = require("devtools/shared/event-emitter");

View File

@ -8,7 +8,7 @@ var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const loaders = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
const { devtools } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const { joinURI } = devtools.require("devtools/shared/path");
const { Services } = devtools.require("resource://gre/modules/Services.jsm");
const Services = devtools.require("Services");
Cu.import("resource://gre/modules/AppConstants.jsm");
const BROWSER_BASED_DIRS = [

View File

@ -6,12 +6,12 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://testing-common/Assert.jsm");
Cu.import("resource://gre/modules/Task.jsm");
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var { gDevTools } = require("devtools/client/framework/devtools");
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
var promise = require("promise");
var Services = require("Services");
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/main");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -6,7 +6,7 @@
const { Ci, Cc } = require("chrome");
const { getJSON } = require("devtools/client/shared/getjson");
const { Services } = require("resource://gre/modules/Services.jsm");
const Services = require("Services");
const promise = require("promise");
const DEVICES_URL = "devtools.devices.url";

View File

@ -5,7 +5,7 @@
"use strict";
const { Ci, Cc } = require("chrome");
const { Services } = require("resource://gre/modules/Services.jsm");
const Services = require("Services");
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
const { Task } = require("resource://gre/modules/Task.jsm");
const { Promise } = require("resource://gre/modules/Promise.jsm");

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci, Cu, ChromeWorker } = require("chrome");
const { Services } = require("resource://gre/modules/Services.jsm");
const { Ci, ChromeWorker } = require("chrome");
const Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
const HOTRELOAD_PREF = "devtools.loader.hotreload";

View File

@ -4,7 +4,7 @@
const {Cu, CC} = require("chrome");
const promise = require("promise");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const XMLHttpRequest = CC("@mozilla.org/xmlextras/xmlhttprequest;1");

View File

@ -24,6 +24,7 @@
"use strict";
const {Ci, Cu, Cc} = require("chrome");
const Services = require("Services");
const HTML_NS = "http://www.w3.org/1999/xhtml";
const CONTENT_TYPES = {
@ -37,7 +38,6 @@ const MAX_POPUP_ENTRIES = 10;
const FOCUS_FORWARD = Ci.nsIFocusManager.MOVEFOCUS_FORWARD;
const FOCUS_BACKWARD = Ci.nsIFocusManager.MOVEFOCUS_BACKWARD;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/shared/event-emitter.js");

View File

@ -1,5 +1,5 @@
const EventEmitter = require("devtools/shared/event-emitter");
const { Services } = require("resource://gre/modules/Services.jsm");
const Services = require("Services");
const { Preferences } = require("resource://gre/modules/Preferences.jsm");
const OPTIONS_SHOWN_EVENT = "options-shown";
const OPTIONS_HIDDEN_EVENT = "options-hidden";

View File

@ -6,7 +6,7 @@
const {Cc, Ci, Cu} = require("chrome");
const {colorUtils} = require("devtools/shared/css-color");
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const HTML_NS = "http://www.w3.org/1999/xhtml";

View File

@ -55,7 +55,7 @@ this.Telemetry = function() {
module.exports = Telemetry;
var {Cc, Ci, Cu} = require("chrome");
var {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
var Services = require("Services");
var {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
Telemetry.prototype = {

View File

@ -158,8 +158,8 @@
}
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm");
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const { gDevTools } = require("devtools/client/framework/devtools");
const StylesheetUtils = require("sdk/stylesheet/utils");
const { watchCSS } = require("devtools/client/shared/css-reload");

View File

@ -11,7 +11,7 @@
const { Ci, Cu } = require("chrome");
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
loader.lazyRequireGetter(this, "Services");
const Services = require("Services");
const { gDevTools } = require("devtools/client/framework/devtools");
const VARIABLES_URI = "chrome://devtools/skin/variables.css";

View File

@ -4,9 +4,9 @@
"use strict";
loader.lazyRequireGetter(this, "Services");
loader.lazyImporter(this, "Task", "resource://gre/modules/Task.jsm");
var Services = require("Services");
var {gDevTools} = require("devtools/client/framework/devtools");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -25,7 +25,7 @@
"use strict";
const {Cc, Cu, Ci} = require("chrome");
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const Promise = require("promise");
const DOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"]
.getService(Ci.inIDOMUtils);

View File

@ -16,10 +16,10 @@ const {colorUtils} = require("devtools/shared/css-color");
const Heritage = require("sdk/core/heritage");
const {Eyedropper} = require("devtools/client/eyedropper/eyedropper");
const Editor = require("devtools/client/sourceeditor/editor");
const Services = require("Services");
loader.lazyRequireGetter(this, "beautify", "devtools/shared/jsbeautify/beautify");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "setNamedTimeout",

View File

@ -17,13 +17,13 @@ const PAGE_SIZE_MAX_JUMPS = 30;
const SEARCH_ACTION_MAX_DELAY = 300; // ms
const ITEM_FLASH_DURATION = 300 // ms
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
Cu.import("resource://devtools/shared/event-emitter.js");
Cu.import("resource://gre/modules/Task.jsm");
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const Services = require("Services");
const promise = require("promise");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",

View File

@ -7,11 +7,11 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
Object.defineProperty(this, "WebConsoleUtils", {

View File

@ -13,10 +13,10 @@ const PANE_APPEARANCE_DELAY = 50;
const PAGE_SIZE_ITEM_COUNT_RATIO = 5;
const WIDGET_FOCUSABLE_NODES = new Set(["vbox", "hbox"]);
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
Cu.import("resource://devtools/shared/event-emitter.js");

View File

@ -11,7 +11,7 @@
const Cu = Components.utils;
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const WARNING_PREF = "devtools.migration.warnings";
if (Services.prefs.getBoolPref(WARNING_PREF)) {

View File

@ -32,11 +32,11 @@ const MAX_VERTICAL_OFFSET = 3;
const RE_SCRATCHPAD_ERROR = /(?:@Scratchpad\/\d+:|\()(\d+):?(\d+)?(?:\)|\n)/;
const RE_JUMP_TO_LINE = /^(\d+):?(\d+)?/;
const Services = require("Services");
const promise = require("promise");
const events = require("devtools/shared/event-emitter");
const { PrefObserver } = require("devtools/client/styleeditor/utils");
Cu.import("resource://gre/modules/Services.jsm");
const L10N = Services.strings.createBundle(L10N_BUNDLE);
const { OS } = Services.appinfo;

View File

@ -21,11 +21,10 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
const PROPERTIES_URL = "chrome://devtools/locale/styleeditor.properties";
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const console = require("resource://gre/modules/Console.jsm").console;
const gStringBundle = Services.strings.createBundle(PROPERTIES_URL);

View File

@ -16,8 +16,8 @@ const Editor = require("devtools/client/sourceeditor/editor");
const promise = require("promise");
const {CssLogic} = require("devtools/shared/inspector/css-logic");
const {console} = require("resource://gre/modules/Console.jsm");
const Services = require("Services");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
const { TextDecoder, OS } = Cu.import("resource://gre/modules/osfile.jsm", {});

View File

@ -9,8 +9,8 @@
const {Cu} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
var Services = require("Services");
var promise = require("promise");
var EventEmitter = require("devtools/shared/event-emitter");

View File

@ -7,8 +7,8 @@
"use strict";
const {Cu} = require("chrome");
const Services = require("Services");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://devtools/shared/event-emitter.js");
exports.PREF_ORIG_SOURCES = "devtools.styleeditor.source-maps-enabled";

View File

@ -9,8 +9,7 @@ const {Cc, Ci, Cu} = require("chrome");
var TiltUtils = require("devtools/client/tilt/tilt-utils");
var {TiltMath, mat4} = require("devtools/client/tilt/tilt-math");
Cu.import("resource://gre/modules/Services.jsm");
var Services = require("Services");
const WEBGL_CONTEXT_NAME = "experimental-webgl";

View File

@ -7,8 +7,8 @@
const {Cc, Ci, Cu} = require("chrome");
const {getRect} = require("devtools/shared/layout/utils");
const Services = require("Services");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const STACK_THICKNESS = 15;

View File

@ -7,13 +7,12 @@
const {Cu, Ci, ChromeWorker} = require("chrome");
var Services = require("Services");
var TiltGL = require("devtools/client/tilt/tilt-gl");
var TiltUtils = require("devtools/client/tilt/tilt-utils");
var TiltVisualizerStyle = require("devtools/client/tilt/tilt-visualizer-style");
var {EPSILON, TiltMath, vec3, mat4, quat4} = require("devtools/client/tilt/tilt-math");
var {TargetFactory} = require("devtools/client/framework/target");
Cu.import("resource://gre/modules/Services.jsm");
var {gDevTools} = require("devtools/client/framework/devtools");
const ELEMENT_MIN_SIZE = 4;

View File

@ -12,8 +12,7 @@ var TiltGL = require("devtools/client/tilt/tilt-gl");
var TiltUtils = require("devtools/client/tilt/tilt-utils");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");
Cu.import("resource://gre/modules/Services.jsm");
var Services = require("Services");
// Tilt notifications dispatched through the nsIObserverService.
const TILT_NOTIFICATIONS = {

View File

@ -5,7 +5,6 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
@ -22,6 +21,7 @@ const L10N = new ViewHelpers.L10N(STRINGS_URI);
const Telemetry = require("devtools/client/shared/telemetry");
const telemetry = new Telemetry();
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const Services = require("Services");
const { gDevTools } = require("devtools/client/framework/devtools");
loader.lazyRequireGetter(this, "LineGraphWidget",

View File

@ -4,21 +4,16 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
// Enable logging for all the tests. Both the debugger server and frontend will
// be affected by this pref.
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
Services.prefs.setBoolPref("devtools.debugger.log", false);
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var { gDevTools } = require("devtools/client/framework/devtools");
var { TargetFactory } = require("devtools/client/framework/target");
var { DebuggerServer } = require("devtools/server/main");
var { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
var Promise = require("promise");
var Services = require("Services");
var { WebAudioFront } = require("devtools/server/actors/webaudio");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
var audioNodes = require("devtools/server/actors/utils/audionodes.json");
@ -37,6 +32,11 @@ const CONNECT_MULTI_PARAM_URL = EXAMPLE_URL + "doc_connect-multi-param.html";
const IFRAME_CONTEXT_URL = EXAMPLE_URL + "doc_iframe-context.html";
const AUTOMATION_URL = EXAMPLE_URL + "doc_automation.html";
// Enable logging for all the tests. Both the debugger server and frontend will
// be affected by this pref.
var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
Services.prefs.setBoolPref("devtools.debugger.log", false);
// All tests are asynchronous.
waitForExplicitFinish();

View File

@ -8,7 +8,7 @@
const {Cc, Ci, Cu} = require("chrome");
const { Services } = require("resource://gre/modules/Services.jsm");
const Services = require("Services");
loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
loader.lazyImporter(this, "escapeHTML", "resource://devtools/client/shared/widgets/VariablesView.jsm");

View File

@ -14,8 +14,8 @@ var {TargetFactory} = require("devtools/client/framework/target");
var {Tools} = require("devtools/client/definitions");
const { Task } = require("resource://gre/modules/Task.jsm");
var promise = require("promise");
var Services = require("Services");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/webconsole", true);
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);

View File

@ -12,11 +12,11 @@ const {Utils: WebConsoleUtils, CONSOLE_WORKER_IDS} =
require("devtools/shared/webconsole/utils");
const promise = require("promise");
const Debugger = require("Debugger");
const Services = require("Services");
loader.lazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1",
"nsIClipboardHelper");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "AutocompletePopup", "devtools/client/shared/autocomplete-popup", true);
loader.lazyRequireGetter(this, "ToolSidebar", "devtools/client/framework/sidebar", true);

View File

@ -11,11 +11,12 @@ const {Cc, Ci, Cu} = require("chrome");
const {Utils: WebConsoleUtils, CONSOLE_WORKER_IDS} =
require("devtools/shared/webconsole/utils");
const promise = require("promise");
const Debugger = require("Debugger");
const Services = require("Services");
loader.lazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1",
"nsIClipboardHelper");
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "AutocompletePopup", "devtools/client/shared/autocomplete-popup", true);
loader.lazyRequireGetter(this, "ToolSidebar", "devtools/client/framework/sidebar", true);

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var Cu = Components.utils;
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const {GetAvailableAddons, ForgetAddonsList} = require("devtools/client/webide/modules/addons");
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var Cu = Components.utils;
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const {AppManager} = require("devtools/client/webide/modules/app-manager");
const {ProjectBuilding} = require("devtools/client/webide/modules/build");

View File

@ -4,7 +4,7 @@
var Cu = Components.utils;
const {require} = Cu.import('resource://devtools/shared/Loader.jsm', {});
const {Services} = Cu.import('resource://gre/modules/Services.jsm');
const Services = require('Services');
const {AppManager} = require('devtools/client/webide/modules/app-manager');
const {AppActorFront} = require('devtools/shared/apps/app-actor-front');
const {Connection} = require('devtools/shared/client/connection-manager');

View File

@ -6,13 +6,13 @@ var Cc = Components.classes;
var Cu = Components.utils;
var Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ZipUtils", "resource://gre/modules/ZipUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
const {AppManager} = require("devtools/client/webide/modules/app-manager");

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var Cu = Components.utils;
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const {AppManager} = require("devtools/client/webide/modules/app-manager");
const {Connection} = require("devtools/shared/client/connection-manager");

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var Cu = Components.utils;
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const {AppManager} = require("devtools/client/webide/modules/app-manager");
const {Connection} = require("devtools/shared/client/connection-manager");
const {RuntimeTypes} = require("devtools/client/webide/modules/runtimes");

View File

@ -7,8 +7,8 @@ var Ci = Components.interfaces;
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const { GetDevices, GetDeviceString } = require("devtools/client/shared/devices");
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
const { Simulators, Simulator } = require("devtools/client/webide/modules/simulators");
const Services = require("Services");
const EventEmitter = require('devtools/shared/event-emitter');
const promise = require("promise");
const utils = require("devtools/client/webide/modules/utils");

View File

@ -5,9 +5,9 @@
"use strict";
var Cu = Components.utils;
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
const { require } =
Cu.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const QR = require("devtools/shared/qrcode/index");
window.addEventListener("load", function onLoad() {

View File

@ -5,7 +5,7 @@
const {Cu} = require("chrome");
const promise = require("promise");
const {AddonManager} = Cu.import("resource://gre/modules/AddonManager.jsm");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const {getJSON} = require("devtools/client/shared/getjson");
const EventEmitter = require("devtools/shared/event-emitter");

View File

@ -5,7 +5,7 @@
const {Cu} = require("chrome");
const EventEmitter = require("devtools/shared/event-emitter");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
var ConfigView;

View File

@ -4,7 +4,7 @@
const {Cu} = require("chrome");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const {AppManager} = require("devtools/client/webide/modules/app-manager");
const EventEmitter = require("devtools/shared/event-emitter");
const {RuntimeScanners, WiFiScanner} = require("devtools/client/webide/modules/runtimes");

View File

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const {Cu, Ci} = require("chrome");
const Services = require("Services");
const {Devices} = Cu.import("resource://devtools/shared/apps/Devices.jsm");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {Connection} = require("devtools/shared/client/connection-manager");
const {DebuggerServer} = require("devtools/server/main");
const {Simulators} = require("devtools/client/webide/modules/simulators");

View File

@ -11,7 +11,7 @@ const Environment = require("sdk/system/environment").env;
const EventEmitter = require("devtools/shared/event-emitter");
const promise = require("promise");
const Subprocess = require("sdk/system/child_process/subprocess");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
loader.lazyGetter(this, "OS", () => {
const Runtime = require("sdk/system/runtime");

View File

@ -4,7 +4,7 @@
const { Cc, Cu, Ci } = require("chrome");
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const Services = require("Services");
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
function doesFileExist (location) {

View File

@ -5,13 +5,13 @@
var {utils: Cu, classes: Cc, interfaces: Ci} = Components;
Cu.import('resource://gre/modules/Services.jsm');
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/Task.jsm");
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const {gDevTools} = require("devtools/client/framework/devtools");
const promise = require("promise");
const Services = require("Services");
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
DevToolsUtils.testing = true;

View File

@ -21,7 +21,7 @@
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const {AppValidator} = require("devtools/client/webide/modules/app-validator");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
const nsFile = Components.Constructor("@mozilla.org/file/local;1",
"nsILocalFile", "initWithPath");
const cr = Cc["@mozilla.org/chrome/chrome-registry;1"]

View File

@ -5,8 +5,7 @@
const {Cc, Ci, Cu, CC} = require("chrome");
const protocol = require("devtools/server/protocol");
const {Arg, method, RetVal} = protocol;
Cu.import("resource://gre/modules/Services.jsm");
const Services = require("Services");
exports.register = function(handle) {
handle.addGlobalActor(PreferenceActor, "preferenceActor");

View File

@ -7,10 +7,10 @@ const protocol = require("devtools/server/protocol");
const {Arg, method, RetVal} = protocol;
const {DebuggerServer} = require("devtools/server/main");
const promise = require("promise");
const Services = require("Services");
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/Services.jsm");
var defaultSettings = {};
var settingsFile;

View File

@ -6,13 +6,13 @@ var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
const {DebuggerClient} = require("devtools/shared/client/main");
const {DebuggerServer} = require("devtools/server/main");
const {defer} = require("promise");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const Services = require("Services");
const PATH = "browser/devtools/server/tests/browser/";
const MAIN_DOMAIN = "http://test1.example.org/" + PATH;

View File

@ -2,7 +2,13 @@ var Cu = Components.utils;
var Cc = Components.classes;
var Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var { DebuggerClient } = require("devtools/shared/client/main");
var { DebuggerServer } = require("devtools/server/main");
var { MemoryFront } = require("devtools/server/actors/memory");
// Always log packets when running tests.
Services.prefs.setBoolPref("devtools.debugger.log", true);
@ -10,13 +16,6 @@ SimpleTest.registerCleanupFunction(function() {
Services.prefs.clearUserPref("devtools.debugger.log");
});
Cu.import("resource://gre/modules/Task.jsm");
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var { DebuggerClient } = require("devtools/shared/client/main");
var { DebuggerServer } = require("devtools/server/main");
var { MemoryFront } = require("devtools/server/actors/memory");
function startServerAndGetSelectedTabMemory() {
DebuggerServer.init();
DebuggerServer.addBrowserActors();

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