Bug 1230192 - Loop's desktop unit tests are doing lots of unnecessary console.log of dispatcher actions. r=dcritch
authorMark Banner <standard8@mozilla.com>
Fri, 04 Dec 2015 17:26:14 +0000
changeset 275643 f682b6e626841acb178c9ab57d2bc924bda7094a
parent 275642 c17fc2bbaaff6784b836eb03caeee7d81356f5cd
child 275644 a258f7e89c8bdfda345641cf302b94cadcdcf06d
push id16567
push usermbanner@mozilla.com
push dateFri, 04 Dec 2015 17:26:55 +0000
treeherderfx-team@f682b6e62684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdcritch
bugs1230192
milestone45.0a1
Bug 1230192 - Loop's desktop unit tests are doing lots of unnecessary console.log of dispatcher actions. r=dcritch
browser/extensions/loop/test/desktop-local/conversation_test.js
browser/extensions/loop/test/desktop-local/panel_test.js
browser/extensions/loop/test/desktop-local/roomStore_test.js
--- a/browser/extensions/loop/test/desktop-local/conversation_test.js
+++ b/browser/extensions/loop/test/desktop-local/conversation_test.js
@@ -24,16 +24,17 @@ describe("loop.conversation", function()
       },
       GetLocale: function() {
         return "en-US";
       },
       SetLoopPref: setLoopPrefStub,
       GetLoopPref: function(prefName) {
         switch (prefName) {
           case "debug.sdk":
+          case "debug.dispatcher":
             return false;
           default:
             return "http://fake";
         }
       },
       GetAllConstants: function() {
         return {
           LOOP_SESSION_TYPE: {
--- a/browser/extensions/loop/test/desktop-local/panel_test.js
+++ b/browser/extensions/loop/test/desktop-local/panel_test.js
@@ -51,17 +51,21 @@ describe("loop.panel", function() {
       },
       GetAllConstants: function() { return {}; },
       GetLocale: function() {
         return "en-US";
       },
       GetPluralRule: sinon.stub(),
       SetLoopPref: sinon.stub(),
       GetLoopPref: function(prefName) {
-        return "unseen";
+        if (prefName === "gettingStarted.seen") {
+          return "unseen";
+        }
+
+        return false;
       },
       GetPluralForm: function() {
         return "fakeText";
       },
       "Rooms:GetAll": function(version) {
         return [];
       },
       "Rooms:PushSubscription": sinon.stub(),
--- a/browser/extensions/loop/test/desktop-local/roomStore_test.js
+++ b/browser/extensions/loop/test/desktop-local/roomStore_test.js
@@ -45,18 +45,20 @@ describe("loop.store.RoomStore", functio
           },
           ROOM_CONTEXT_ADD: {
             ADD_FROM_PANEL: 0,
             ADD_FROM_CONVERSATION: 1
           }
         };
       },
       CopyString: sinon.stub(),
-      GetLoopPref: function(pref) {
-        return pref;
+      GetLoopPref: function(prefName) {
+        if (prefName === "debug.dispatcher") {
+          return false;
+        }
       },
       NotifyUITour: function() {},
       "Rooms:Create": sinon.stub().returns({ roomToken: "fakeToken" }),
       "Rooms:Delete": sinon.stub(),
       "Rooms:GetAll": sinon.stub(),
       "Rooms:Open": sinon.stub(),
       "Rooms:Rename": sinon.stub(),
       "Rooms:PushSubscription": sinon.stub(),