Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/filterStorage.js

Issue 29416573: Issue 5153 - Simplify patterns.ini parsing (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created April 18, 2017, 1:33 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/data/patterns.ini ('k') | test/filterStorage_readwrite.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterStorage.js
===================================================================
--- a/test/filterStorage.js
+++ b/test/filterStorage.js
@@ -74,28 +74,28 @@ exports.testAddingSubscriptions = functi
}
FilterNotifier.addListener(listener);
compareSubscriptionList(test, "Initial state", []);
test.deepEqual(changes, [], "Received changes");
changes = [];
FilterStorage.addSubscription(subscription1);
- compareSubscriptionList(test, "Regular add", [subscription1]);
+ compareSubscriptionList(test, "Adding first subscription", [subscription1]);
test.deepEqual(changes, ["subscription.added http://test1/"], "Received changes");
changes = [];
FilterStorage.addSubscription(subscription1);
compareSubscriptionList(test, "Adding already added subscription", [subscription1]);
test.deepEqual(changes, [], "Received changes");
changes = [];
- FilterStorage.addSubscription(subscription2, true);
- compareSubscriptionList(test, "Silent add", [subscription1, subscription2]);
- test.deepEqual(changes, [], "Received changes");
+ FilterStorage.addSubscription(subscription2);
+ compareSubscriptionList(test, "Adding second", [subscription1, subscription2]);
+ test.deepEqual(changes, ["subscription.added http://test2/"], "Received changes");
FilterStorage.removeSubscription(subscription1);
compareSubscriptionList(test, "Remove", [subscription2]);
changes = [];
FilterStorage.addSubscription(subscription1);
compareSubscriptionList(test, "Re-adding previously removed subscription", [subscription2, subscription1]);
test.deepEqual(changes, ["subscription.added http://test1/"], "Received changes");
@@ -118,28 +118,28 @@ exports.testRemovingSubscriptions = func
}
FilterNotifier.addListener(listener);
compareSubscriptionList(test, "Initial state", [subscription1, subscription2]);
test.deepEqual(changes, [], "Received changes");
changes = [];
FilterStorage.removeSubscription(subscription1);
- compareSubscriptionList(test, "Regular remove", [subscription2]);
+ compareSubscriptionList(test, "Removing first subscription", [subscription2]);
test.deepEqual(changes, ["subscription.removed http://test1/"], "Received changes");
changes = [];
FilterStorage.removeSubscription(subscription1);
compareSubscriptionList(test, "Removing already removed subscription", [subscription2]);
test.deepEqual(changes, [], "Received changes");
changes = [];
- FilterStorage.removeSubscription(subscription2, true);
- compareSubscriptionList(test, "Silent remove", []);
- test.deepEqual(changes, [], "Received changes");
+ FilterStorage.removeSubscription(subscription2);
+ compareSubscriptionList(test, "Removing remaining subscription", []);
+ test.deepEqual(changes, ["subscription.removed http://test2/"], "Received changes");
FilterStorage.addSubscription(subscription1);
compareSubscriptionList(test, "Add", [subscription1]);
changes = [];
FilterStorage.removeSubscription(subscription1);
compareSubscriptionList(test, "Re-removing previously added subscription", []);
test.deepEqual(changes, ["subscription.removed http://test1/"], "Received changes");
@@ -245,19 +245,19 @@ exports.testAddingFilters = function(tes
test.deepEqual(changes, ["filter.added foo#bar"], "Received changes");
changes = [];
FilterStorage.addFilter(Filter.fromText("foo#@#bar"));
compareFiltersList(test, "Adding hiding exception", [["foo"], ["@@bar", "foo#bar", "foo#@#bar"], []]);
test.deepEqual(changes, ["filter.added foo#@#bar"], "Received changes");
changes = [];
- FilterStorage.addFilter(Filter.fromText("!foobar"), undefined, undefined, true);
- compareFiltersList(test, "Adding comment silent", [["foo"], ["@@bar", "foo#bar", "foo#@#bar"], ["!foobar"]]);
- test.deepEqual(changes, [], "Received changes");
+ FilterStorage.addFilter(Filter.fromText("!foobar"));
+ compareFiltersList(test, "Adding comment", [["foo"], ["@@bar", "foo#bar", "foo#@#bar"], ["!foobar"]]);
+ test.deepEqual(changes, ["filter.added !foobar"], "Received changes");
changes = [];
FilterStorage.addFilter(Filter.fromText("foo"));
compareFiltersList(test, "Adding already added filter", [["foo"], ["@@bar", "foo#bar", "foo#@#bar"], ["!foobar"]]);
test.deepEqual(changes, [], "Received changes");
subscription1.disabled = true;
« no previous file with comments | « test/data/patterns.ini ('k') | test/filterStorage_readwrite.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld