OLD | NEW |
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 subscription3.disabled = false; | 328 subscription3.disabled = false; |
329 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); | 329 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); |
330 | 330 |
331 test.done(); | 331 test.done(); |
332 }; | 332 }; |
333 | 333 |
334 exports.testSnippetFilters = function(test) | 334 exports.testSnippetFilters = function(test) |
335 { | 335 { |
336 let filter1 = Filter.fromText("example.com#$#filter1"); | 336 let filter1 = Filter.fromText("example.com#$#filter1"); |
337 let filter2 = Filter.fromText("example.com#$#filter2"); | 337 let filter2 = Filter.fromText("example.com#$#filter2"); |
| 338 let filter3 = Filter.fromText("example.com#$#filter3"); |
338 | 339 |
339 let subscription1 = Subscription.fromURL("http://test1/"); | 340 let subscription1 = Subscription.fromURL("http://test1/"); |
340 subscription1.filters = [filter1, filter2]; | 341 subscription1.filters = [filter1, filter2]; |
341 | 342 |
342 FilterStorage.addSubscription(subscription1); | 343 FilterStorage.addSubscription(subscription1); |
343 checkKnownFilters(test, "add subscription with filter1 and filter2", {}); | 344 checkKnownFilters(test, "add subscription with filter1 and filter2", {}); |
344 | 345 |
345 let subscription2 = Subscription.fromURL("http://test2/"); | 346 let subscription2 = Subscription.fromURL("http://test2/"); |
346 subscription2.type = "circumvention"; | 347 subscription2.type = "circumvention"; |
347 subscription2.filters = [filter1]; | 348 subscription2.filters = [filter1]; |
348 | 349 |
349 FilterStorage.addSubscription(subscription2); | 350 FilterStorage.addSubscription(subscription2); |
350 checkKnownFilters(test, "add subscription of type circumvention with filter1",
{snippets: [filter1.text]}); | 351 checkKnownFilters(test, "add subscription of type circumvention with filter1",
{snippets: [filter1.text]}); |
351 | 352 |
352 let subscription3 = Subscription.fromURL("~foo"); | 353 let subscription3 = Subscription.fromURL("~foo"); |
353 subscription3.filters = [filter2]; | 354 subscription3.filters = [filter2]; |
354 | 355 |
355 FilterStorage.addSubscription(subscription3); | 356 FilterStorage.addSubscription(subscription3); |
356 checkKnownFilters(test, "add special subscription with filter2", {snippets: [f
ilter1.text, filter2.text]}); | 357 checkKnownFilters(test, "add special subscription with filter2", {snippets: [f
ilter1.text, filter2.text]}); |
357 | 358 |
| 359 let subscription4 = Subscription.fromURL("https://easylist-downloads.adblockpl
us.org/abp-filters-anti-cv.txt"); |
| 360 subscription4.filters = [filter3]; |
| 361 |
| 362 FilterStorage.addSubscription(subscription4); |
| 363 checkKnownFilters(test, "add ABP anti-circumvention subscription with filter3"
, {snippets: [filter1.text, filter2.text, filter3.text]}); |
| 364 |
358 test.done(); | 365 test.done(); |
359 }; | 366 }; |
OLD | NEW |