From 731d45a8e8faf1f209632d5093bef5b554e26bb6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 21 Feb 2015 06:45:54 +0000 Subject: Ensure inconito mode flag and find-mode-history are initialised. See #1495. --- tests/dom_tests/chrome.coffee | 2 ++ tests/unit_tests/exclusion_test.coffee | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/dom_tests/chrome.coffee b/tests/dom_tests/chrome.coffee index d6c03fc1..5f276649 100644 --- a/tests/dom_tests/chrome.coffee +++ b/tests/dom_tests/chrome.coffee @@ -27,3 +27,5 @@ root.chrome = sync: get: -> set: -> + onChanged: + addListener: -> diff --git a/tests/unit_tests/exclusion_test.coffee b/tests/unit_tests/exclusion_test.coffee index b3ed7194..287d699d 100644 --- a/tests/unit_tests/exclusion_test.coffee +++ b/tests/unit_tests/exclusion_test.coffee @@ -21,6 +21,10 @@ extend(global, require "../../background_scripts/exclusions.js") extend(global, require "../../background_scripts/commands.js") extend(global, require "../../background_scripts/main.js") +dummyTab = + tab: + incognito: false + # These tests cover only the most basic aspects of excluded URLs and passKeys. # context "Excluded URLs and pass keys", @@ -36,22 +40,22 @@ context "Excluded URLs and pass keys", ]) should "be disabled for excluded sites", -> - rule = isEnabledForUrl({ url: 'http://mail.google.com/calendar/page' }) + rule = isEnabledForUrl({ url: 'http://mail.google.com/calendar/page' }, dummyTab) assert.isFalse rule.isEnabledForUrl assert.isFalse rule.passKeys should "be disabled for excluded sites, one exclusion", -> - rule = isEnabledForUrl({ url: 'http://www.bbc.com/calendar/page' }) + rule = isEnabledForUrl({ url: 'http://www.bbc.com/calendar/page' }, dummyTab) assert.isFalse rule.isEnabledForUrl assert.isFalse rule.passKeys should "be enabled, but with pass keys", -> - rule = isEnabledForUrl({ url: 'https://www.facebook.com/something' }) + rule = isEnabledForUrl({ url: 'https://www.facebook.com/something' }, dummyTab) assert.isTrue rule.isEnabledForUrl assert.equal rule.passKeys, 'abcd' should "be enabled", -> - rule = isEnabledForUrl({ url: 'http://www.twitter.com/pages' }) + rule = isEnabledForUrl({ url: 'http://www.twitter.com/pages' }, dummyTab) assert.isTrue rule.isEnabledForUrl assert.isFalse rule.passKeys -- cgit v1.2.3