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

Delta Between Two Patch Sets: test/filterStorage.js

Issue 30025555: Issue 6820 - Move tests to mocha (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Rebased. Created April 5, 2019, 4:16 p.m.
Right Patch Set: Rebased Created April 10, 2019, 6:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/filterNotifier.js ('k') | test/filterStorage_readwrite.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 function compareFiltersList(testMessage, list) 73 function compareFiltersList(testMessage, list)
74 { 74 {
75 let result = [...filterStorage.subscriptions()].map( 75 let result = [...filterStorage.subscriptions()].map(
76 subscription => [...subscription.filterText()]); 76 subscription => [...subscription.filterText()]);
77 assert.deepEqual(result, list, testMessage); 77 assert.deepEqual(result, list, testMessage);
78 } 78 }
79 79
80 function compareFilterSubscriptions(testMessage, filter, list) 80 function compareFilterSubscriptions(testMessage, filter, list)
81 { 81 {
82 let result = [...filter.subscriptions()].map(subscription => subscription.ur l); 82 let result = [...filterStorage.subscriptions(filter.text)].map(subscription => subscription.url);
83 let expected = list.map(subscription => subscription.url); 83 let expected = list.map(subscription => subscription.url);
84 assert.deepEqual(result, expected, testMessage); 84 assert.deepEqual(result, expected, testMessage);
85 } 85 }
86 86
87 it("Adding Subscriptions", () => 87 it("Adding Subscriptions", () =>
88 { 88 {
89 let subscription1 = Subscription.fromURL("http://test1/"); 89 let subscription1 = Subscription.fromURL("http://test1/");
90 let subscription2 = Subscription.fromURL("http://test2/"); 90 let subscription2 = Subscription.fromURL("http://test2/");
91 91
92 let changes = []; 92 let changes = [];
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 compareFilterSubscriptions("filter2 subscriptions after updating http://test 3/ filters", filter2, [subscription2, subscription3]); 503 compareFilterSubscriptions("filter2 subscriptions after updating http://test 3/ filters", filter2, [subscription2, subscription3]);
504 compareFilterSubscriptions("filter3 subscriptions after updating http://test 3/ filters", filter3, [subscription2]); 504 compareFilterSubscriptions("filter3 subscriptions after updating http://test 3/ filters", filter3, [subscription2]);
505 505
506 filterStorage.removeSubscription(subscription3); 506 filterStorage.removeSubscription(subscription3);
507 507
508 compareFilterSubscriptions("filter1 subscriptions after removing http://test 3/", filter1, []); 508 compareFilterSubscriptions("filter1 subscriptions after removing http://test 3/", filter1, []);
509 compareFilterSubscriptions("filter2 subscriptions after removing http://test 3/", filter2, [subscription2]); 509 compareFilterSubscriptions("filter2 subscriptions after removing http://test 3/", filter2, [subscription2]);
510 compareFilterSubscriptions("filter3 subscriptions after removing http://test 3/", filter3, [subscription2]); 510 compareFilterSubscriptions("filter3 subscriptions after removing http://test 3/", filter3, [subscription2]);
511 }); 511 });
512 }); 512 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld