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

Side by Side Diff: test/filterStorage.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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 function compareFiltersList(test, testMessage, list) 72 function compareFiltersList(test, testMessage, list)
73 { 73 {
74 let result = [...filterStorage.subscriptions()].map( 74 let result = [...filterStorage.subscriptions()].map(
75 subscription => [...subscription.filterText()]); 75 subscription => [...subscription.filterText()]);
76 test.deepEqual(result, list, testMessage); 76 test.deepEqual(result, list, testMessage);
77 } 77 }
78 78
79 function compareFilterSubscriptions(test, testMessage, filter, list) 79 function compareFilterSubscriptions(test, testMessage, filter, list)
80 { 80 {
81 let result = [...filter.subscriptions()].map(subscription => subscription.url) ; 81 let result = [...filterStorage.subscriptions(filter.text)].map(subscription => subscription.url);
82 let expected = list.map(subscription => subscription.url); 82 let expected = list.map(subscription => subscription.url);
83 test.deepEqual(result, expected, testMessage); 83 test.deepEqual(result, expected, testMessage);
84 } 84 }
85 85
86 exports.testAddingSubscriptions = function(test) 86 exports.testAddingSubscriptions = function(test)
87 { 87 {
88 let subscription1 = Subscription.fromURL("http://test1/"); 88 let subscription1 = Subscription.fromURL("http://test1/");
89 let subscription2 = Subscription.fromURL("http://test2/"); 89 let subscription2 = Subscription.fromURL("http://test2/");
90 90
91 let changes = []; 91 let changes = [];
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 compareFilterSubscriptions(test, "filter3 subscriptions after updating http:// test3/ filters", filter3, [subscription2]); 517 compareFilterSubscriptions(test, "filter3 subscriptions after updating http:// test3/ filters", filter3, [subscription2]);
518 518
519 filterStorage.removeSubscription(subscription3); 519 filterStorage.removeSubscription(subscription3);
520 520
521 compareFilterSubscriptions(test, "filter1 subscriptions after removing http:// test3/", filter1, []); 521 compareFilterSubscriptions(test, "filter1 subscriptions after removing http:// test3/", filter1, []);
522 compareFilterSubscriptions(test, "filter2 subscriptions after removing http:// test3/", filter2, [subscription2]); 522 compareFilterSubscriptions(test, "filter2 subscriptions after removing http:// test3/", filter2, [subscription2]);
523 compareFilterSubscriptions(test, "filter3 subscriptions after removing http:// test3/", filter3, [subscription2]); 523 compareFilterSubscriptions(test, "filter3 subscriptions after removing http:// test3/", filter3, [subscription2]);
524 524
525 test.done(); 525 test.done();
526 }; 526 };
OLDNEW

Powered by Google App Engine
This is Rietveld