| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 subscription2.disabled = false; | 291 subscription2.disabled = false; |
| 292 checkKnownFilters(test, "enable blocking filters", {blacklist: [filter1.text]}
); | 292 checkKnownFilters(test, "enable blocking filters", {blacklist: [filter1.text]}
); |
| 293 | 293 |
| 294 let subscription3 = Subscription.fromURL("~wl~"); | 294 let subscription3 = Subscription.fromURL("~wl~"); |
| 295 subscription3.disabled = true; | 295 subscription3.disabled = true; |
| 296 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text]}
); | 296 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text]}
); |
| 297 | 297 |
| 298 FilterStorage.addFilter(filter2); | 298 FilterStorage.addFilter(filter2); |
| 299 checkKnownFilters(test, "add @@filter2", {blacklist: [filter1.text], whitelist
: [filter2.text]}); | 299 checkKnownFilters(test, "add @@filter2", {blacklist: [filter1.text], whitelist
: [filter2.text]}); |
| 300 test.equal(filter2.subscriptions.length, 1, "@@filter2.subscription.length"); | 300 test.equal(filter2.subscriptions.size, 1, "@@filter2.subscription.length"); |
| 301 test.ok(filter2.subscriptions[0] instanceof SpecialSubscription, "@@filter2 ad
ded to a new filter group"); | 301 test.ok([...filter2.subscriptions][0] instanceof SpecialSubscription, "@@filte
r2 added to a new filter group"); |
| 302 test.ok(filter2.subscriptions[0] != subscription3, "@@filter2 filter group is
not the disabled exceptions group"); | 302 test.ok([...filter2.subscriptions][0] != subscription3, "@@filter2 filter grou
p is not the disabled exceptions group"); |
| 303 | 303 |
| 304 subscription3.disabled = false; | 304 subscription3.disabled = false; |
| 305 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); | 305 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); |
| 306 | 306 |
| 307 FilterStorage.removeFilter(filter2); | 307 FilterStorage.removeFilter(filter2); |
| 308 FilterStorage.addFilter(filter2); | 308 FilterStorage.addFilter(filter2); |
| 309 checkKnownFilters(test, "re-add @@filter2", {blacklist: [filter1.text], whitel
ist: [filter2.text]}); | 309 checkKnownFilters(test, "re-add @@filter2", {blacklist: [filter1.text], whitel
ist: [filter2.text]}); |
| 310 test.equal(filter2.subscriptions.length, 1, "@@filter2.subscription.length"); | 310 test.equal(filter2.subscriptions.size, 1, "@@filter2.subscription.length"); |
| 311 test.ok(filter2.subscriptions[0] == subscription3, "@@filter2 added to the def
ault exceptions group"); | 311 test.ok([...filter2.subscriptions][0] == subscription3, "@@filter2 added to th
e default exceptions group"); |
| 312 | 312 |
| 313 let subscription4 = Subscription.fromURL("http://test/"); | 313 let subscription4 = Subscription.fromURL("http://test/"); |
| 314 FilterStorage.updateSubscriptionFilters(subscription4, [filter3, filter4, filt
er5]); | 314 FilterStorage.updateSubscriptionFilters(subscription4, [filter3, filter4, filt
er5]); |
| 315 checkKnownFilters(test, "update subscription not in the list yet", {blacklist:
[filter1.text], whitelist: [filter2.text]}); | 315 checkKnownFilters(test, "update subscription not in the list yet", {blacklist:
[filter1.text], whitelist: [filter2.text]}); |
| 316 | 316 |
| 317 FilterStorage.addSubscription(subscription4); | 317 FilterStorage.addSubscription(subscription4); |
| 318 checkKnownFilters(test, "add subscription to the list", {blacklist: [filter1.t
ext, filter3.text], whitelist: [filter2.text, filter4.text]}); | 318 checkKnownFilters(test, "add subscription to the list", {blacklist: [filter1.t
ext, filter3.text], whitelist: [filter2.text, filter4.text]}); |
| 319 | 319 |
| 320 FilterStorage.updateSubscriptionFilters(subscription4, [filter3, filter2, filt
er5]); | 320 FilterStorage.updateSubscriptionFilters(subscription4, [filter3, filter2, filt
er5]); |
| 321 checkKnownFilters(test, "update subscription while in the list", {blacklist: [
filter1.text, filter3.text], whitelist: [filter2.text]}); | 321 checkKnownFilters(test, "update subscription while in the list", {blacklist: [
filter1.text, filter3.text], whitelist: [filter2.text]}); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 351 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]}); |
| 352 | 352 |
| 353 let subscription3 = Subscription.fromURL("~foo"); | 353 let subscription3 = Subscription.fromURL("~foo"); |
| 354 subscription3.filters = [filter2]; | 354 subscription3.filters = [filter2]; |
| 355 | 355 |
| 356 FilterStorage.addSubscription(subscription3); | 356 FilterStorage.addSubscription(subscription3); |
| 357 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]}); |
| 358 | 358 |
| 359 test.done(); | 359 test.done(); |
| 360 }; | 360 }; |
| OLD | NEW |