Bug 1102240 - Move inspector actor to dedicated folder;r=pbro
MozReview-Commit-ID: LNgHweYJXcB
--- a/devtools/client/framework/toolbox-highlighter-utils.js
+++ b/devtools/client/framework/toolbox-highlighter-utils.js
@@ -211,17 +211,17 @@ exports.getHighlighterUtils = function (
function onPickerNodeCanceled() {
cancelPicker();
toolbox.win.focus();
}
/**
* Show the box model highlighter on a node in the content page.
* The node needs to be a NodeFront, as defined by the inspector actor
- * @see devtools/server/actors/inspector.js
+ * @see devtools/server/actors/inspector/inspector.js
* @param {NodeFront} nodeFront The node to highlight
* @param {Object} options
* @return A promise that resolves when the node has been highlighted
*/
let highlightNodeFront = exported.highlightNodeFront = requireInspector(
function* (nodeFront, options = {}) {
if (!nodeFront) {
return;
--- a/devtools/client/inspector/markup/test/actor_events_form.js
+++ b/devtools/client/inspector/markup/test/actor_events_form.js
@@ -6,17 +6,17 @@
// This test actor is used for testing the addition of custom form data
// on NodeActor. Custom form property is set when 'form' event is sent
// by NodeActor actor (see 'onNodeActorForm' method).
const EventEmitter = require("devtools/shared/event-emitter");
const {ActorClassWithSpec, Actor, FrontClassWithSpec, Front, generateActorSpec} =
require("devtools/shared/protocol");
-const {NodeActor} = require("devtools/server/actors/inspector");
+const {NodeActor} = require("devtools/server/actors/inspector/inspector");
var eventsSpec = generateActorSpec({
typeName: "eventsFormActor",
methods: {
attach: {
request: {},
response: {}
--- a/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_textcontent_edit_01.js
@@ -2,17 +2,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test editing a node's text content
const TEST_URL = URL_ROOT + "doc_markup_edit.html";
-const {DEFAULT_VALUE_SUMMARY_LENGTH} = require("devtools/server/actors/inspector");
+const {DEFAULT_VALUE_SUMMARY_LENGTH} = require("devtools/server/actors/inspector/inspector");
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Expanding all nodes");
yield inspector.markup.expandAll();
yield waitForMultipleChildrenUpdates(inspector);
--- a/devtools/server/actors/highlighters/box-model.js
+++ b/devtools/server/actors/highlighters/box-model.js
@@ -13,17 +13,17 @@ const {
hasPseudoClassLock,
isNodeValid,
moveInfobar,
} = require("./utils/markup");
const {
setIgnoreLayoutChanges,
getCurrentZoom,
} = require("devtools/shared/layout/utils");
-const inspector = require("devtools/server/actors/inspector");
+const inspector = require("devtools/server/actors/inspector/inspector");
const nodeConstants = require("devtools/shared/dom-node-constants");
// Note that the order of items in this array is important because it is used
// for drawing the BoxModelHighlighter's path elements correctly.
const BOX_MODEL_REGIONS = ["margin", "border", "padding", "content"];
const BOX_MODEL_SIDES = ["top", "right", "bottom", "left"];
// Width of boxmodelhighlighter guides
const GUIDE_STROKE_WIDTH = 1;
rename from devtools/server/actors/inspector.js
rename to devtools/server/actors/inspector/inspector.js
new file mode 100644
--- /dev/null
+++ b/devtools/server/actors/inspector/moz.build
@@ -0,0 +1,12 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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/.
+
+DevToolsModules(
+ 'inspector.js',
+)
+
+with Files('**'):
+ BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')
--- a/devtools/server/actors/moz.build
+++ b/devtools/server/actors/moz.build
@@ -2,16 +2,17 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
DIRS += [
'emulation',
'highlighters',
+ 'inspector',
'utils',
'webconsole',
]
DevToolsModules(
'accessibility.js',
'actor-registry.js',
'addon.js',
@@ -78,19 +79,16 @@ with Files('breakpoint.js'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Debugger')
with Files('css-properties.js'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: CSS Rules Inspector')
with Files('csscoverage.js'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Graphics Commandline and Toolbar')
-with Files('inspector.js'):
- BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')
-
with Files('memory.js'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Memory')
with Files('monitor.js'):
BUG_COMPONENT = ('Firefox', 'Developer Tools')
with Files('performance*'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Performance Tools (Profiler/Timeline)')
--- a/devtools/server/actors/webextension-inspected-window.js
+++ b/devtools/server/actors/webextension-inspected-window.js
@@ -6,17 +6,17 @@
const protocol = require("devtools/shared/protocol");
const {Ci, Cu, Cr} = require("chrome");
const {DebuggerServer} = require("devtools/server/main");
const Services = require("Services");
-loader.lazyGetter(this, "NodeActor", () => require("devtools/server/actors/inspector").NodeActor, true);
+loader.lazyGetter(this, "NodeActor", () => require("devtools/server/actors/inspector/inspector").NodeActor, true);
const {
XPCOMUtils,
} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
const {
webExtensionInspectedWindowSpec,
} = require("devtools/shared/specs/webextension-inspected-window");
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -444,17 +444,17 @@ var DebuggerServer = {
* Install tab actors.
*/
_addTabActors() {
this.registerModule("devtools/server/actors/webconsole", {
prefix: "console",
constructor: "WebConsoleActor",
type: { tab: true }
});
- this.registerModule("devtools/server/actors/inspector", {
+ this.registerModule("devtools/server/actors/inspector/inspector", {
prefix: "inspector",
constructor: "InspectorActor",
type: { tab: true }
});
this.registerModule("devtools/server/actors/call-watcher", {
prefix: "callWatcher",
constructor: "CallWatcherActor",
type: { tab: true }
--- a/devtools/server/tests/mochitest/inspector-helpers.js
+++ b/devtools/server/tests/mochitest/inspector-helpers.js
@@ -10,17 +10,17 @@ const {require} = Cu.import("resource://
const {DebuggerClient} = require("devtools/shared/client/debugger-client");
const {DebuggerServer} = require("devtools/server/main");
const { Task } = require("devtools/shared/task");
const Services = require("Services");
// promise is still used in tests using this helper
const promise = require("promise"); // eslint-disable-line no-unused-vars
const defer = require("devtools/shared/defer");
-const {_documentWalker} = require("devtools/server/actors/inspector");
+const {_documentWalker} = require("devtools/server/actors/inspector/inspector");
// Always log packets when running tests.
Services.prefs.setBoolPref("devtools.debugger.log", true);
SimpleTest.registerCleanupFunction(function () {
Services.prefs.clearUserPref("devtools.debugger.log");
});
if (!DebuggerServer.initialized) {
--- a/devtools/server/tests/mochitest/test_highlighter_paused_debugger.html
+++ b/devtools/server/tests/mochitest/test_highlighter_paused_debugger.html
@@ -14,17 +14,17 @@ Test the PausedDebuggerOverlay highlight
<script>
"use strict";
window.onload = function () {
SimpleTest.waitForExplicitFinish();
const {utils: Cu} = Components;
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
- require("devtools/server/actors/inspector");
+ require("devtools/server/actors/inspector/inspector");
const {HighlighterEnvironment} = require("devtools/server/actors/highlighters");
const {PausedDebuggerOverlay} = require("devtools/server/actors/highlighters/paused-debugger");
const env = new HighlighterEnvironment();
env.initFromWindow(window);
const highlighter = new PausedDebuggerOverlay(env);
const anonymousContent = highlighter.markup.content;
--- a/devtools/server/tests/mochitest/test_inspector-anonymous.html
+++ b/devtools/server/tests/mochitest/test_inspector-anonymous.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<script type="application/javascript" src="inspector-helpers.js"></script>
<script type="application/javascript">
"use strict";
window.onload = function () {
const {InspectorFront} =
require("devtools/shared/fronts/inspector");
const {_documentWalker} =
- require("devtools/server/actors/inspector");
+ require("devtools/server/actors/inspector/inspector");
const nodeFilterConstants =
require("devtools/shared/dom-node-filter-constants");
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const isStylo = SpecialPowers.DOMWindowUtils.isStyledByServo;
SpecialPowers.pushPrefEnv({"set": [
["dom.webcomponents.shadowdom.enabled", true]
--- a/devtools/server/tests/mochitest/test_inspector-insert.html
+++ b/devtools/server/tests/mochitest/test_inspector-insert.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<title>Test for Bug </title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
<script type="application/javascript" src="inspector-helpers.js"></script>
<script type="application/javascript">
"use strict";
-const inspector = require("devtools/server/actors/inspector");
+const inspector = require("devtools/server/actors/inspector/inspector");
window.onload = function () {
SimpleTest.waitForExplicitFinish();
runNextTest();
};
let gWalker = null;
let gInspectee = null;
--- a/devtools/server/tests/mochitest/test_inspector-mutations-value.html
+++ b/devtools/server/tests/mochitest/test_inspector-mutations-value.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<title>Test for Bug </title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
<script type="application/javascript" src="inspector-helpers.js"></script>
<script type="application/javascript">
"use strict";
-const inspector = require("devtools/server/actors/inspector");
+const inspector = require("devtools/server/actors/inspector/inspector");
window.onload = function () {
SimpleTest.waitForExplicitFinish();
runNextTest();
};
const testSummaryLength = 10;
inspector.setValueSummaryLength(testSummaryLength);
--- a/devtools/server/tests/mochitest/test_inspector-traversal.html
+++ b/devtools/server/tests/mochitest/test_inspector-traversal.html
@@ -279,17 +279,17 @@ addTest(function testFrameTraversal() {
let expected = expectedParents.shift();
is(parent.nodeName, expected, "Got expected parent");
}
}).then(runNextTest));
});
addTest(function testLongValue() {
const testSummaryLength = 10;
- const inspector = require("devtools/server/actors/inspector");
+ const inspector = require("devtools/server/actors/inspector/inspector");
inspector.setValueSummaryLength(testSummaryLength);
SimpleTest.registerCleanupFunction(function () {
inspector.setValueSummaryLength(inspector.DEFAULT_VALUE_SUMMARY_LENGTH);
});
let longstringText = gInspectee.getElementById("longstring").firstChild.nodeValue;
--- a/devtools/server/tests/unit/test_nodelistactor.js
+++ b/devtools/server/tests/unit/test_nodelistactor.js
@@ -1,17 +1,17 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that a NodeListActor initialized with null nodelist doesn't cause
// exceptions when calling NodeListActor.form.
-const { NodeListActor } = require("devtools/server/actors/inspector");
+const { NodeListActor } = require("devtools/server/actors/inspector/inspector");
function run_test() {
check_actor_for_list(null);
check_actor_for_list([]);
check_actor_for_list(["fakenode"]);
}
function check_actor_for_list(nodelist) {
--- a/devtools/shared/gcli/commands/highlight.js
+++ b/devtools/shared/gcli/commands/highlight.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
"use strict";
const l10n = require("gcli/l10n");
-require("devtools/server/actors/inspector");
+require("devtools/server/actors/inspector/inspector");
const {HighlighterEnvironment} = require("devtools/server/actors/highlighters");
const {BoxModelHighlighter} = require("devtools/server/actors/highlighters/box-model");
const {PluralForm} = require("devtools/shared/plural-form");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/shared/locales/gclicommands.properties");
// How many maximum nodes can be highlighted in parallel
--- a/devtools/shared/gcli/commands/measure.js
+++ b/devtools/shared/gcli/commands/measure.js
@@ -5,17 +5,17 @@
"use strict";
const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "CommandState",
"devtools/shared/gcli/command-state", true);
const l10n = require("gcli/l10n");
-require("devtools/server/actors/inspector");
+require("devtools/server/actors/inspector/inspector");
const { HighlighterEnvironment } =
require("devtools/server/actors/highlighters");
const { MeasuringToolHighlighter } =
require("devtools/server/actors/highlighters/measuring-tool");
const highlighters = new WeakMap();
exports.items = [
--- a/devtools/shared/gcli/commands/rulers.js
+++ b/devtools/shared/gcli/commands/rulers.js
@@ -5,17 +5,17 @@
"use strict";
const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "CommandState",
"devtools/shared/gcli/command-state", true);
const l10n = require("gcli/l10n");
-require("devtools/server/actors/inspector");
+require("devtools/server/actors/inspector/inspector");
const { HighlighterEnvironment } =
require("devtools/server/actors/highlighters");
const { RulersHighlighter } =
require("devtools/server/actors/highlighters/rulers");
const highlighters = new WeakMap();
exports.items = [