Bug 1597622 - add test for kiosk mode enabled; r=andreio
☠☠ backed out by 82ae4e73b3ba ☠ ☠
authorLiang-Heng Chen <xeonchen@gmail.com>
Wed, 04 Dec 2019 09:48:49 +0000
changeset 505293 8fc8a1f595788306652351e0971ecaf13880a1fe
parent 505292 4c5f5aad4fd76c7c4040f24d88f7b7695332c540
child 505294 82ae4e73b3baacc7490690c3287c3d2ab13fc7d2
push id36881
push userdvarga@mozilla.com
push dateWed, 04 Dec 2019 16:22:31 +0000
treeherdermozilla-central@13fb375eaf14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandreio
bugs1597622
milestone73.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 1597622 - add test for kiosk mode enabled; r=andreio Differential Revision: https://phabricator.services.mozilla.com/D55778
browser/components/newtab/test/unit/asrouter/ASRouter.test.js
--- a/browser/components/newtab/test/unit/asrouter/ASRouter.test.js
+++ b/browser/components/newtab/test/unit/asrouter/ASRouter.test.js
@@ -2539,16 +2539,30 @@ describe("ASRouter", () => {
       assert.calledOnce(Router.onMessage);
       assert.calledWithExactly(Router.onMessage, {
         target,
         data: { type: "TRIGGER", data: { trigger } },
       });
     });
   });
 
+  describe("_triggerHandler_kiosk", () => {
+    it("should not call #onMessage", () => {
+      const getter = sandbox.stub();
+      getter.returns(true);
+      sandbox.stub(global.BrowserHandler, "kiosk").get(getter);
+      sinon.spy(Router, "onMessage");
+      const target = {};
+      const trigger = { id: "FAKE_TRIGGER", param: "some fake param" };
+      Router._triggerHandler(target, trigger);
+      assert.notCalled(Router.onMessage);
+    });
+  });
+
+
   describe("#UITour", () => {
     let showMenuStub;
     const highlightTarget = { target: "target" };
     beforeEach(() => {
       showMenuStub = sandbox.stub();
       globals.set("UITour", {
         showMenu: showMenuStub,
         getTarget: sandbox