aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Blott2016-03-26 13:39:27 +0000
committerStephen Blott2016-03-26 13:39:27 +0000
commite2ea471eff20504b53da36a791769d246fff9593 (patch)
tree0fa9b664f24b1706659bf7c2e6cf4e2c177bc2e7 /tests
parenta1103158551ace4232b613d290f5d193a7c5185f (diff)
downloadvimium-e2ea471eff20504b53da36a791769d246fff9593.tar.bz2
Add test for badly-formed exclusion regexp.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/exclusion_test.coffee5
-rw-r--r--tests/unit_tests/test_chrome_stubs.coffee1
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit_tests/exclusion_test.coffee b/tests/unit_tests/exclusion_test.coffee
index 54cb4ed3..f53d23f6 100644
--- a/tests/unit_tests/exclusion_test.coffee
+++ b/tests/unit_tests/exclusion_test.coffee
@@ -16,6 +16,7 @@ extend(global, require "../../lib/utils.js")
Utils.getCurrentVersion = -> '1.44'
extend(global,require "../../lib/settings.js")
extend(global,require "../../lib/clipboard.js")
+extend(global, require "../../background_scripts/bg_utils.js")
extend(global, require "../../background_scripts/exclusions.js")
extend(global, require "../../background_scripts/commands.js")
extend(global, require "../../background_scripts/main.js")
@@ -70,3 +71,7 @@ context "Excluded URLs and pass keys",
assert.isTrue rule.isEnabledForUrl
assert.equal "abcdef", rule.passKeys
+ should "be enabled for malformed regular expressions", ->
+ Exclusions.postUpdateHook [ { pattern: "http*://www.bad-regexp.com/*[a-", passKeys: "" } ]
+ rule = isEnabledForUrl({ url: 'http://www.bad-regexp.com/pages' })
+ assert.isTrue rule.isEnabledForUrl
diff --git a/tests/unit_tests/test_chrome_stubs.coffee b/tests/unit_tests/test_chrome_stubs.coffee
index bbcd01e7..b0b527c5 100644
--- a/tests/unit_tests/test_chrome_stubs.coffee
+++ b/tests/unit_tests/test_chrome_stubs.coffee
@@ -30,6 +30,7 @@ exports.chrome =
extension:
getURL: (path) -> path
getBackgroundPage: -> {}
+ getViews: -> []
tabs:
onSelectionChanged: