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

Unified Diff: test/filterListener.js

Issue 30013628: Issue 7029 - Remove subscriptions property of Filter object (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Feb. 24, 2019, 1:30 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
Index: test/filterListener.js
===================================================================
--- a/test/filterListener.js
+++ b/test/filterListener.js
@@ -301,28 +301,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.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");
+ test.equal([...filterStorage.subscriptions(filter2.text)].length, 1, "@@filter2 subscription count");
+ test.ok([...filterStorage.subscriptions(filter2.text)][0] instanceof SpecialSubscription, "@@filter2 added to a new filter group");
+ test.ok([...filterStorage.subscriptions(filter2.text)][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.subscriptionCount, 1, "@@filter2.subscriptionCount");
- test.ok([...filter2.subscriptions()][0] == subscription3, "@@filter2 added to the default exceptions group");
+ test.equal([...filterStorage.subscriptions(filter2.text)].length, 1, "@@filter2 subscription count");
+ test.ok([...filterStorage.subscriptions(filter2.text)][0] == subscription3, "@@filter2 added to the default exceptions group");
let subscription4 = Subscription.fromURL("http://test/");
filterStorage.updateSubscriptionFilters(subscription4, [filter3.text, filter4.text, filter5.text]);
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]});

Powered by Google App Engine
This is Rietveld