Bug 1442680 - Ensure that the paths of all console mochitests have been updated to new-console-output paths r=Honza
authorMike Ratcliffe <mratcliffe@mozilla.com>
Fri, 02 Mar 2018 23:07:04 +0000
changeset 461564 0f1d3b47e1930e8e8fccca54dc06d6ca5df3c3cf
parent 461563 7a1eb24a2257c8fc3935005a3104f7873567d024
child 461565 55b683e679b0056b216b25a6274bbdc1f90e5a28
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1442680
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442680 - Ensure that the paths of all console mochitests have been updated to new-console-output paths r=Honza MozReview-Commit-ID: 5mrc3cJ3Xo1
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_no_autocompletion_on_defined_variables.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_netmonitor_shows_reqs_in_webconsole.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_closure_inspection.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_js_input_expansion.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_longstring_hang.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_shows_reqs_from_netmonitor.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_shows_reqs_in_netmonitor.js
devtools/client/webconsole/new-console-output/test/mochitest/sjs_cors-test-server.sjs
devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-passwords-web-console-warning.html
devtools/client/webconsole/new-console-output/test/mochitest/test-network-request.html
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -2,16 +2,17 @@
 tags = devtools
 subsuite = devtools
 support-files =
   code_bundle_invalidmap.js
   code_bundle_invalidmap.js.map
   code_bundle_nosource.js
   code_bundle_nosource.js.map
   head.js
+  sjs_cors-test-server.sjs
   sjs_slow-response-test-server.sjs
   source-mapped.css
   source-mapped.css.map
   source-mapped.scss
   test_bug_770099_violation.html
   test_bug_770099_violation.html^headers^
   test_console_csp_ignore_reflected_xss_message.html
   test_console_csp_ignore_reflected_xss_message.html^headers^
@@ -227,17 +228,16 @@ skip-if = os != 'mac' # The tested ctrl+
 [browser_jsterm_no_autocompletion_on_defined_variables.js]
 [browser_jsterm_no_input_and_tab_key_pressed.js]
 [browser_jsterm_no_input_change_and_tab_key_pressed.js]
 [browser_jsterm_null_undefined.js]
 [browser_jsterm_popup_close_on_tab_switch.js]
 [browser_jsterm_popup.js]
 [browser_jsterm_selfxss.js]
 subsuite = clipboard
-[browser_netmonitor_shows_reqs_in_webconsole.js]
 [browser_webconsole_allow_mixedcontent_securityerrors.js]
 tags = mcb
 [browser_webconsole_batching.js]
 [browser_webconsole_block_mixedcontent_securityerrors.js]
 tags = mcb
 [browser_webconsole_cached_messages.js]
 [browser_webconsole_cd_iframe.js]
 [browser_webconsole_certificate_messages.js]
@@ -334,16 +334,17 @@ subsuite = clipboard
 [browser_webconsole_persist.js]
 [browser_webconsole_reopen_closed_tab.js]
 [browser_webconsole_repeat_different_objects.js]
 [browser_webconsole_sandbox_update_after_navigation.js]
 [browser_webconsole_script_errordoc_urls.js]
 [browser_webconsole_scroll.js]
 [browser_webconsole_select_all.js]
 [browser_webconsole_show_subresource_security_errors.js]
+[browser_webconsole_shows_reqs_from_netmonitor.js]
 [browser_webconsole_shows_reqs_in_netmonitor.js]
 [browser_webconsole_sourcemap_css.js]
 [browser_webconsole_sourcemap_error.js]
 [browser_webconsole_sourcemap_invalid.js]
 [browser_webconsole_sourcemap_nosource.js]
 [browser_webconsole_split.js]
 [browser_webconsole_split_escape_key.js]
 [browser_webconsole_split_focus.js]
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_no_autocompletion_on_defined_variables.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_no_autocompletion_on_defined_variables.js
@@ -1,19 +1,21 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/ */
 
+/* import-globals-from head.js */
+
 // Tests for bug 704295
 
 "use strict";
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-console.html";
+                 "new-console-output/test/mochitest/test-console.html";
 
 add_task(async function () {
   let hud = await openNewTabAndConsole(TEST_URI);
   testCompletion(hud);
 });
 
 function testCompletion(hud) {
   let jsterm = hud.jsterm;
deleted file mode 100644
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_netmonitor_shows_reqs_in_webconsole.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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";
-
-const TEST_URI = "data:text/html;charset=utf8,Test that the netmonitor " +
-                 "displays requests that have been recorded in the " +
-                 "web console, even if the netmonitor hadn't opened yet.";
-
-const TEST_FILE = "test-network-request.html";
-const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
-                  "test/" + TEST_FILE;
-
-const NET_PREF = "devtools.webconsole.filter.net";
-Services.prefs.setBoolPref(NET_PREF, true);
-registerCleanupFunction(() => {
-  Services.prefs.clearUserPref(NET_PREF);
-});
-
-add_task(async function task() {
-  // Test that the request appears in the console.
-  const hud = await openNewTabAndConsole(TEST_URI);
-  const currentTab = gBrowser.selectedTab;
-  info("Web console is open");
-
-  const onMessageAdded = waitForMessages({
-    hud,
-    messages: [{
-      text: TEST_PATH,
-    }]
-  });
-
-  await loadDocument(TEST_PATH);
-  info("Document loaded.");
-
-  await onMessageAdded;
-  info("Network message found.");
-
-  // Test that the request appears in the network panel.
-  let target = TargetFactory.forTab(currentTab);
-  let toolbox = await gDevTools.showToolbox(target, "netmonitor");
-  info("Network panel is open.");
-
-  await testNetmonitor(toolbox);
-});
-
-async function testNetmonitor(toolbox) {
-  let monitor = toolbox.getCurrentPanel();
-
-  let { store, windowRequire } = monitor.panelWin;
-  let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
-  let { getSortedRequests } =
-    windowRequire("devtools/client/netmonitor/src/selectors/index");
-
-  store.dispatch(Actions.batchEnable(false));
-
-  await waitUntil(() => store.getState().requests.requests.size > 0);
-
-  is(store.getState().requests.requests.size, 1,
-    "Network request appears in the network panel");
-
-  let item = getSortedRequests(store.getState()).get(0);
-  is(item.method, "GET", "The attached method is correct.");
-  is(item.url, TEST_PATH, "The attached url is correct.");
-}
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_closure_inspection.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_closure_inspection.js
@@ -1,20 +1,22 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/ */
 
+/* import-globals-from head.js */
+
 // Check that inspecting a closure in the variables view sidebar works when
 // execution is paused.
 
 "use strict";
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-closures.html";
+                 "new-console-output/test/mochitest/test-closures.html";
 
 var gWebConsole, gJSTerm, gVariablesView;
 
 // Force the old debugger UI since it's directly used (see Bug 1301705)
 Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
 registerCleanupFunction(function* () {
   Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
 });
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_js_input_expansion.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_js_input_expansion.js
@@ -1,19 +1,21 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/ */
 
+/* import-globals-from head.js */
+
 // Tests that the input box expands as the user types long lines.
 
 "use strict";
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-console.html";
+                 "new-console-output/test/mochitest/test-console.html";
 
 add_task(async function () {
   const { jsterm } = await openNewTabAndConsole(TEST_URI);
   jsterm.clearOutput();
 
   const { inputNode } = jsterm;
   const getInputHeight = () => inputNode.clientHeight;
 
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_longstring_hang.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_longstring_hang.js
@@ -1,19 +1,22 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/ */
 
+/* import-globals-from head.js */
+
 // Test that very long strings do not hang the browser.
 
 "use strict";
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-bug-859170-longstring-hang.html";
+                 "new-console-output/test/mochitest/" +
+                 "test-bug-859170-longstring-hang.html";
 
 add_task(function* () {
   yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   info("wait for the initial long string");
 
new file mode 100644
--- /dev/null
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_shows_reqs_from_netmonitor.js
@@ -0,0 +1,67 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* 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";
+
+const TEST_URI = "data:text/html;charset=utf8,Test that the netmonitor " +
+                 "displays requests that have been recorded in the " +
+                 "web console, even if the netmonitor hadn't opened yet.";
+
+const TEST_FILE = "test-network-request.html";
+const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
+                  "new-console-output/test/mochitest/" + TEST_FILE;
+
+const NET_PREF = "devtools.webconsole.filter.net";
+Services.prefs.setBoolPref(NET_PREF, true);
+registerCleanupFunction(() => {
+  Services.prefs.clearUserPref(NET_PREF);
+});
+
+add_task(async function task() {
+  // Test that the request appears in the console.
+  const hud = await openNewTabAndConsole(TEST_URI);
+  const currentTab = gBrowser.selectedTab;
+  info("Web console is open");
+
+  const onMessageAdded = waitForMessages({
+    hud,
+    messages: [{
+      text: TEST_PATH,
+    }]
+  });
+
+  await loadDocument(TEST_PATH);
+  info("Document loaded.");
+
+  await onMessageAdded;
+  info("Network message found.");
+
+  // Test that the request appears in the network panel.
+  let target = TargetFactory.forTab(currentTab);
+  let toolbox = await gDevTools.showToolbox(target, "netmonitor");
+  info("Network panel is open.");
+
+  await testNetmonitor(toolbox);
+});
+
+async function testNetmonitor(toolbox) {
+  let monitor = toolbox.getCurrentPanel();
+
+  let { store, windowRequire } = monitor.panelWin;
+  let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
+  let { getSortedRequests } =
+    windowRequire("devtools/client/netmonitor/src/selectors/index");
+
+  store.dispatch(Actions.batchEnable(false));
+
+  await waitUntil(() => store.getState().requests.requests.size > 0);
+
+  is(store.getState().requests.requests.size, 1,
+    "Network request appears in the network panel");
+
+  let item = getSortedRequests(store.getState()).get(0);
+  is(item.method, "GET", "The attached method is correct.");
+  is(item.url, TEST_PATH, "The attached url is correct.");
+}
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_shows_reqs_in_netmonitor.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_shows_reqs_in_netmonitor.js
@@ -6,17 +6,17 @@
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,Test that the web console " +
                  "displays requests that have been recorded in the " +
                  "netmonitor, even if the console hadn't opened yet.";
 
 const TEST_FILE = "test-network-request.html";
 const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
-                  "test/" + TEST_FILE;
+                  "new-console-output/test/mochitest/" + TEST_FILE;
 
 const NET_PREF = "devtools.webconsole.filter.net";
 Services.prefs.setBoolPref(NET_PREF, true);
 registerCleanupFunction(() => {
   Services.prefs.clearUserPref(NET_PREF);
 });
 
 add_task(async function () {
new file mode 100644
--- /dev/null
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/sjs_cors-test-server.sjs
@@ -0,0 +1,17 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function handleRequest(request, response) {
+  response.setStatusLine(request.httpVersion, 200, "Och Aye");
+
+  response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
+  response.setHeader("Pragma", "no-cache");
+  response.setHeader("Expires", "0");
+
+  response.setHeader("Access-Control-Allow-Origin", "*", false);
+  response.setHeader("Access-Control-Allow-Headers", "content-type", false);
+
+  response.setHeader("Content-Type", "text/plain; charset=utf-8", false);
+
+  response.write("Access-Control-Allow-Origin: *");
+}
--- a/devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-passwords-web-console-warning.html
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-passwords-web-console-warning.html
@@ -4,13 +4,12 @@
     <meta charset="utf8">
     <title>Bug 762593 - Add warning/error Message to Web Console when the
       page includes Insecure Password fields</title>
     <!-- Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/ -->
   </head>
   <body>
     <p>This page is served with an iframe with insecure password field.</p>
-    <iframe src
-      ="http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-frame.html">
+    <iframe src="test-insecure-frame.html">
     </iframe>
   </body>
 </html>
--- a/devtools/client/webconsole/new-console-output/test/mochitest/test-network-request.html
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/test-network-request.html
@@ -21,30 +21,30 @@
         xmlhttp.send(requestBody);
       }
 
       function testXhrGet(callback) {
         makeXhr("get", "test-data.json", null, callback);
       }
 
       function testXhrWarn(callback) {
-        makeXhr("get", "http://example.com/browser/devtools/client/netmonitor/test/sjs_cors-test-server.sjs", null, callback);
+        makeXhr("get", "sjs_cors-test-server.sjs", null, callback);
       }
 
       function testXhrPost(callback) {
         makeXhr("post", "test-data.json", "Hello world!", callback);
       }
 
       function testXhrPostSlowResponse(callback) {
         makeXhr("post", "sjs_slow-response-test-server.sjs", "Hello world!", callback);
       }
     </script>
   </head>
   <body>
     <h1>Heads Up Display HTTP Logging Testpage</h1>
     <h2>This page is used to test the HTTP logging.</h2>
 
-    <form action="https://example.com/browser/devtools/client/webconsole/test/test-network-request.html" method="post">
+    <form action="test-network-request.html" method="post">
       <input name="name" type="text" value="foo bar"><br>
       <input name="age" type="text" value="144"><br>
     </form>
   </body>
 </html>