| Left: | ||
| Right: |
| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 filter2.delete(); | 259 filter2.delete(); |
| 260 | 260 |
| 261 test.done(); | 261 test.done(); |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 exports.testNotifications = function(test) | 264 exports.testNotifications = function(test) |
| 265 { | 265 { |
| 266 function checkNotifications(action, expected, message) | 266 function checkNotifications(action, expected, message) |
| 267 { | 267 { |
| 268 let result = null; | 268 let result = null; |
| 269 let listener = (topic, subscription, newValue, oldValue) => | 269 let listener = (topic, subscription) => |
|
sergei
2017/04/19 12:18:03
newValue and oldValue arguments are not used anymo
Wladimir Palant
2017/04/20 08:03:14
Done.
| |
| 270 { | 270 { |
| 271 if (result) | 271 if (result) |
| 272 test.ok(false, "Got more that one notification - " + message); | 272 test.ok(false, "Got more that one notification - " + message); |
| 273 else | 273 else |
| 274 result = [topic, subscription.url]; | 274 result = [topic, subscription.url]; |
| 275 }; | 275 }; |
| 276 FilterNotifier.addListener(listener); | 276 FilterNotifier.addListener(listener); |
| 277 action(); | 277 action(); |
| 278 FilterNotifier.removeListener(listener); | 278 FilterNotifier.removeListener(listener); |
| 279 test.deepEqual(result, expected, message); | 279 test.deepEqual(result, expected, message); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 subscription.errors++; | 360 subscription.errors++; |
| 361 }, ["subscription.errors", "http://example.com/"], "Increasing subscription.er rors"); | 361 }, ["subscription.errors", "http://example.com/"], "Increasing subscription.er rors"); |
| 362 checkNotifications(() => | 362 checkNotifications(() => |
| 363 { | 363 { |
| 364 subscription.errors = 0; | 364 subscription.errors = 0; |
| 365 }, ["subscription.errors", "http://example.com/"], "Resetting subscription.err os"); | 365 }, ["subscription.errors", "http://example.com/"], "Resetting subscription.err os"); |
| 366 | 366 |
| 367 subscription.delete(); | 367 subscription.delete(); |
| 368 test.done(); | 368 test.done(); |
| 369 }; | 369 }; |
| LEFT | RIGHT |