Bug 1405637 - Remove duplicated test browser_webconsole_notifications;r=nchevobbe draft
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 17 Jan 2018 11:06:32 +0100
changeset 721399 e2ec3f78e04f87e8951fde4de0e0d3ceabfa57c3
parent 721362 a8f0b70ca9a2787278b5e86d43b22a1e7cfd4ff0
child 746341 9a091443cf06e164e9f37a7f679fe94d8f56d976
push id95845
push userjdescottes@mozilla.com
push dateWed, 17 Jan 2018 10:07:47 +0000
reviewersnchevobbe
bugs1405637, 1304003
milestone59.0a1
Bug 1405637 - Remove duplicated test browser_webconsole_notifications;r=nchevobbe Test was already migrated in Bug 1304003 to browser_webconsole_observer_notifications.js. MozReview-Commit-ID: DyfVJ49ksSd
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_notifications.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -324,18 +324,16 @@ skip-if = true #	Bug 1404886
 [browser_webconsole_network_attach.js]
 [browser_webconsole_network_exceptions.js]
 [browser_webconsole_network_messages_expand.js]
 [browser_webconsole_network_messages_openinnet.js]
 [browser_webconsole_network_requests_from_chrome.js]
 [browser_webconsole_network_reset_filter.js]
 [browser_webconsole_nodes_highlight.js]
 [browser_webconsole_nodes_select.js]
-[browser_webconsole_notifications.js]
-skip-if = true #	Bug 1405637
 [browser_webconsole_object_in_sidebar.js]
 [browser_webconsole_object_inspector.js]
 [browser_webconsole_object_inspector_entries.js]
 [browser_webconsole_observer_notifications.js]
 [browser_webconsole_optimized_out_vars.js]
 [browser_webconsole_output_copy.js]
 subsuite = clipboard
 skip-if = true #	Bug 1404364
deleted file mode 100644
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_notifications.js
+++ /dev/null
@@ -1,77 +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=utf-8,<p>Web Console test for " +
-                 "notifications";
-
-add_task(function* () {
-  yield loadTab(TEST_URI);
-
-  let consoleOpened = defer();
-  let gotEvents = waitForEvents(consoleOpened.promise);
-  yield openConsole().then(() => {
-    consoleOpened.resolve();
-  });
-
-  yield gotEvents;
-});
-
-function waitForEvents(onConsoleOpened) {
-  let deferred = defer();
-
-  function webConsoleCreated(id) {
-    Services.obs.removeObserver(observer, "web-console-created");
-    ok(HUDService.getHudReferenceById(id), "We have a hud reference");
-    content.wrappedJSObject.console.log("adding a log message");
-  }
-
-  function webConsoleDestroyed(id) {
-    Services.obs.removeObserver(observer, "web-console-destroyed");
-    ok(!HUDService.getHudReferenceById(id), "We do not have a hud reference");
-    executeSoon(deferred.resolve);
-  }
-
-  function webConsoleMessage(id, nodeID) {
-    Services.obs.removeObserver(observer, "web-console-message-created");
-    ok(id, "we have a console ID");
-    is(typeof nodeID, "string", "message node id is a string");
-    onConsoleOpened.then(closeConsole);
-  }
-
-  let observer = {
-
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
-
-    observe: function observe(subject, topic, data) {
-      subject = subject.QueryInterface(Ci.nsISupportsString);
-
-      switch (topic) {
-        case "web-console-created":
-          webConsoleCreated(subject.data);
-          break;
-        case "web-console-destroyed":
-          webConsoleDestroyed(subject.data);
-          break;
-        case "web-console-message-created":
-          webConsoleMessage(subject, data);
-          break;
-        default:
-          break;
-      }
-    },
-
-    init: function init() {
-      Services.obs.addObserver(this, "web-console-created");
-      Services.obs.addObserver(this, "web-console-destroyed");
-      Services.obs.addObserver(this, "web-console-message-created");
-    }
-  };
-
-  observer.init();
-
-  return deferred.promise;
-}
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js
@@ -1,22 +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/ */
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for " +
-                 "obeserver notifications";
+                 "observer notifications";
 
 let created = false;
 let destroyed = false;
 
-add_task(async function() {
+add_task(async function () {
   setupObserver();
   await openNewTabAndConsole(TEST_URI);
   await waitFor(() => created);
 
   await closeTabAndToolbox(gBrowser.selectedTab);
   await waitFor(() => destroyed);
 });