Index: test/elemHide.js |
=================================================================== |
--- a/test/elemHide.js |
+++ b/test/elemHide.js |
@@ -268,8 +268,37 @@ |
ElemHide.remove(Filter.fromText("example.com##test")); |
test.equal(filtersByDomain.size, 2); |
ElemHide.remove(Filter.fromText("example.com,~www.example.com##test")); |
test.equal(filtersByDomain.size, 0); |
test.done(); |
}; |
+ |
+exports.testGenericSelectorDedup = function(test) |
+{ |
+ ElemHide.add(Filter.fromText("##test1")); |
+ ElemHide.add(Filter.fromText("##test2")); |
+ ElemHide.add(Filter.fromText("##test3")); |
+ |
+ test.equal(ElemHide.getSelectorsForDomain("foo.example.com"), |
+ ElemHide.getSelectorsForDomain("bar.example.com")); |
+ |
+ ElemHide.add(Filter.fromText("foo.example.com##test4")); |
+ |
+ test.notEqual(ElemHide.getSelectorsForDomain("foo.example.com"), |
+ ElemHide.getSelectorsForDomain("bar.example.com")); |
+ |
+ ElemHide.remove(Filter.fromText("foo.example.com##test4")); |
+ |
+ test.equal(ElemHide.getSelectorsForDomain("foo.example.com"), |
+ ElemHide.getSelectorsForDomain("bar.example.com")); |
+ |
+ ElemHide.remove(Filter.fromText("##test1")); |
+ ElemHide.remove(Filter.fromText("##test2")); |
+ ElemHide.remove(Filter.fromText("##test3")); |
+ |
+ test.equal(ElemHide.getSelectorsForDomain("foo.example.com"), |
+ ElemHide.getSelectorsForDomain("bar.example.com")); |
+ |
+ test.done(); |
+}; |