| LEFT | RIGHT |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| LEFT | RIGHT |