aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Blott2015-02-21 06:45:54 +0000
committerStephen Blott2015-02-23 06:25:48 +0000
commit731d45a8e8faf1f209632d5093bef5b554e26bb6 (patch)
treede9d18e0ec901410c124f8ee62d6c8ee77592217 /tests
parent30485767273aabdd1190ba84b3002f8f15526695 (diff)
downloadvimium-731d45a8e8faf1f209632d5093bef5b554e26bb6.tar.bz2
Ensure inconito mode flag and find-mode-history are initialised.
See #1495.
Diffstat (limited to 'tests')
-rw-r--r--tests/dom_tests/chrome.coffee2
-rw-r--r--tests/unit_tests/exclusion_test.coffee12
2 files changed, 10 insertions, 4 deletions
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