summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js')
-rw-r--r--devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js118
1 files changed, 118 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js b/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
new file mode 100644
index 000000000..dca8167c4
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
@@ -0,0 +1,118 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+/* eslint key-spacing: 0 */
+"use strict";
+
+// Testing that the gcli 'inspect' command works as it should.
+
+const TEST_URI = URL_ROOT + "doc_inspector_gcli-inspect-command.html";
+
+add_task(function* () {
+ return helpers.addTabWithToolbar(TEST_URI, Task.async(function* (options) {
+ let {inspector} = yield openInspector();
+
+ let checkSelection = Task.async(function* (selector) {
+ let node = yield getNodeFront(selector, inspector);
+ is(inspector.selection.nodeFront, node, "the current selection is correct");
+ });
+
+ yield helpers.audit(options, [
+ {
+ setup: "inspect",
+ check: {
+ input: "inspect",
+ hints: " <selector>",
+ markup: "VVVVVVV",
+ status: "ERROR",
+ args: {
+ selector: {
+ message: "Value required for \u2018selector\u2019."
+ },
+ }
+ },
+ },
+ {
+ setup: "inspect div",
+ check: {
+ input: "inspect div",
+ hints: "",
+ markup: "VVVVVVVVVVV",
+ status: "VALID",
+ args: {
+ selector: { message: "" },
+ }
+ },
+ exec: {},
+ post: () => checkSelection("div"),
+ },
+ {
+ setup: "inspect .someclass",
+ check: {
+ input: "inspect .someclass",
+ hints: "",
+ markup: "VVVVVVVVVVVVVVVVVV",
+ status: "VALID",
+ args: {
+ selector: { message: "" },
+ }
+ },
+ exec: {},
+ post: () => checkSelection(".someclass"),
+ },
+ {
+ setup: "inspect #someid",
+ check: {
+ input: "inspect #someid",
+ hints: "",
+ markup: "VVVVVVVVVVVVVVV",
+ status: "VALID",
+ args: {
+ selector: { message: "" },
+ }
+ },
+ exec: {},
+ post: () => checkSelection("#someid"),
+ },
+ {
+ setup: "inspect button[disabled]",
+ check: {
+ input: "inspect button[disabled]",
+ hints: "",
+ markup: "VVVVVVVVVVVVVVVVVVVVVVVV",
+ status: "VALID",
+ args: {
+ selector: { message: "" },
+ }
+ },
+ exec: {},
+ post: () => checkSelection("button[disabled]"),
+ },
+ {
+ setup: "inspect p>strong",
+ check: {
+ input: "inspect p>strong",
+ hints: "",
+ markup: "VVVVVVVVVVVVVVVV",
+ status: "VALID",
+ args: {
+ selector: { message: "" },
+ }
+ },
+ exec: {},
+ post: () => checkSelection("p>strong"),
+ },
+ {
+ setup: "inspect :root",
+ check: {
+ input: "inspect :root",
+ hints: "",
+ markup: "VVVVVVVVVVVVV",
+ status: "VALID"
+ },
+ exec: {},
+ post: () => checkSelection(":root"),
+ },
+ ]);
+ }));
+});