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

Unified Diff: test/filterListener.js

Issue 29870577: Issue 6916 - Encapsulate filter subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Add subscriptionCount property Created Sept. 1, 2018, 2:16 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 | « lib/iniParser.js ('k') | test/filterStorage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterListener.js
===================================================================
--- a/test/filterListener.js
+++ b/test/filterListener.js
@@ -291,28 +291,28 @@
checkKnownFilters(test, "enable blocking filters", {blacklist: [filter1.text]});
let subscription3 = Subscription.fromURL("~wl~");
subscription3.disabled = true;
checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text]});
FilterStorage.addFilter(filter2);
checkKnownFilters(test, "add @@filter2", {blacklist: [filter1.text], whitelist: [filter2.text]});
- test.equal(filter2.subscriptions.size, 1, "@@filter2.subscription.length");
- test.ok([...filter2.subscriptions][0] instanceof SpecialSubscription, "@@filter2 added to a new filter group");
- test.ok([...filter2.subscriptions][0] != subscription3, "@@filter2 filter group is not the disabled exceptions group");
+ test.equal(filter2.subscriptionCount, 1, "@@filter2.subscriptionCount");
+ test.ok([...filter2.subscriptions()][0] instanceof SpecialSubscription, "@@filter2 added to a new filter group");
+ test.ok([...filter2.subscriptions()][0] != subscription3, "@@filter2 filter group is not the disabled exceptions group");
subscription3.disabled = false;
checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]});
FilterStorage.removeFilter(filter2);
FilterStorage.addFilter(filter2);
checkKnownFilters(test, "re-add @@filter2", {blacklist: [filter1.text], whitelist: [filter2.text]});
- test.equal(filter2.subscriptions.size, 1, "@@filter2.subscription.length");
- test.ok([...filter2.subscriptions][0] == subscription3, "@@filter2 added to the default exceptions group");
+ test.equal(filter2.subscriptionCount, 1, "@@filter2.subscriptionCount");
+ test.ok([...filter2.subscriptions()][0] == subscription3, "@@filter2 added to the default exceptions group");
let subscription4 = Subscription.fromURL("http://test/");
FilterStorage.updateSubscriptionFilters(subscription4, [filter3, filter4, filter5]);
checkKnownFilters(test, "update subscription not in the list yet", {blacklist: [filter1.text], whitelist: [filter2.text]});
FilterStorage.addSubscription(subscription4);
checkKnownFilters(test, "add subscription to the list", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text, filter4.text]});
« no previous file with comments | « lib/iniParser.js ('k') | test/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld