summaryrefslogtreecommitdiffstats
path: root/devtools/client/commandline/test/browser_cmd_listen.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/commandline/test/browser_cmd_listen.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/commandline/test/browser_cmd_listen.js')
-rw-r--r--devtools/client/commandline/test/browser_cmd_listen.js80
1 files changed, 80 insertions, 0 deletions
diff --git a/devtools/client/commandline/test/browser_cmd_listen.js b/devtools/client/commandline/test/browser_cmd_listen.js
new file mode 100644
index 000000000..91746c2aa
--- /dev/null
+++ b/devtools/client/commandline/test/browser_cmd_listen.js
@@ -0,0 +1,80 @@
+/* Any copyright is dedicated to the Public Domain.
+* http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Tests that the listen/unlisten commands work as they should.
+
+const TEST_URI = "http://example.com/browser/devtools/client/commandline/" +
+ "test/browser_cmd_cookie.html";
+
+function test() {
+ return Task.spawn(testTask).then(finish, helpers.handleError);
+}
+
+var tests = {
+ testInput: function (options) {
+ return helpers.audit(options, [
+ {
+ setup: "listen",
+ check: {
+ input: "listen",
+ markup: "VVVVVV",
+ status: "VALID"
+ },
+ },
+ {
+ setup: "unlisten",
+ check: {
+ input: "unlisten",
+ markup: "VVVVVVVV",
+ status: "VALID"
+ },
+ exec: {
+ output: "All TCP ports closed"
+ }
+ },
+ {
+ setup: function () {
+ return helpers.setInput(options, "listen");
+ },
+ check: {
+ input: "listen",
+ hints: " [port] [protocol]",
+ markup: "VVVVVV",
+ status: "VALID"
+ },
+ exec: {
+ output: "Listening on port " + Services.prefs
+ .getIntPref("devtools.debugger.remote-port")
+ }
+ },
+ {
+ setup: function () {
+ return helpers.setInput(options, "listen 8000");
+ },
+ exec: {
+ output: "Listening on port 8000"
+ }
+ },
+ {
+ setup: function () {
+ return helpers.setInput(options, "unlisten");
+ },
+ exec: {
+ output: "All TCP ports closed"
+ }
+ }
+ ]);
+ },
+};
+
+function* testTask() {
+ Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
+ let options = yield helpers.openTab(TEST_URI);
+ yield helpers.openToolbar(options);
+
+ yield helpers.runTests(options, tests);
+
+ yield helpers.closeToolbar(options);
+ yield helpers.closeTab(options);
+ Services.prefs.clearUserPref("devtools.debugger.remote-enabled");
+}