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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 16 matching lines...) Expand all Loading... |
27 let Prefs = null; | 27 let Prefs = null; |
28 let Subscription = null; | 28 let Subscription = null; |
29 let Synchronizer = null; | 29 let Synchronizer = null; |
30 | 30 |
31 exports.setUp = function(callback) | 31 exports.setUp = function(callback) |
32 { | 32 { |
33 let globals = Object.assign({}, setupTimerAndXMLHttp.call(this), | 33 let globals = Object.assign({}, setupTimerAndXMLHttp.call(this), |
34 setupRandomResult.call(this)); | 34 setupRandomResult.call(this)); |
35 | 35 |
36 let sandboxedRequire = createSandbox({globals}); | 36 let sandboxedRequire = createSandbox({globals}); |
37 | |
38 ( | 37 ( |
39 {Filter} = sandboxedRequire("../lib/filterClasses"), | 38 {Filter} = sandboxedRequire("../lib/filterClasses"), |
40 {FilterStorage} = sandboxedRequire("../lib/filterStorage"), | 39 {FilterStorage} = sandboxedRequire("../lib/filterStorage"), |
41 {Prefs} = sandboxedRequire("./stub-modules/prefs"), | 40 {Prefs} = sandboxedRequire("./stub-modules/prefs"), |
42 {Subscription} = sandboxedRequire("../lib/subscriptionClasses"), | 41 {Subscription} = sandboxedRequire("../lib/subscriptionClasses"), |
43 {Synchronizer} = sandboxedRequire("../lib/synchronizer") | 42 {Synchronizer} = sandboxedRequire("../lib/synchronizer") |
44 ); | 43 ); |
45 | 44 |
46 callback(); | 45 callback(); |
47 }; | 46 }; |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 return this.runScheduledTasks(24); | 555 return this.runScheduledTasks(24); |
557 }).then(() => | 556 }).then(() => |
558 { | 557 { |
559 test.equal(subscription.downloadStatus, "synchronize_connection_error", "dow
nloadStatus after download error"); | 558 test.equal(subscription.downloadStatus, "synchronize_connection_error", "dow
nloadStatus after download error"); |
560 test.equal(subscription.lastDownload * MILLIS_IN_SECOND, startTime + (26 + i
nitialDelay) * MILLIS_IN_HOUR, "lastDownload after download error"); | 559 test.equal(subscription.lastDownload * MILLIS_IN_SECOND, startTime + (26 + i
nitialDelay) * MILLIS_IN_HOUR, "lastDownload after download error"); |
561 test.equal(subscription.lastSuccess * MILLIS_IN_SECOND, startTime + initialD
elay * MILLIS_IN_HOUR, "lastSuccess after download error"); | 560 test.equal(subscription.lastSuccess * MILLIS_IN_SECOND, startTime + initialD
elay * MILLIS_IN_HOUR, "lastSuccess after download error"); |
562 test.equal(subscription.lastCheck * MILLIS_IN_SECOND, startTime + (27 + init
ialDelay) * MILLIS_IN_HOUR, "lastCheck after download error"); | 561 test.equal(subscription.lastCheck * MILLIS_IN_SECOND, startTime + (27 + init
ialDelay) * MILLIS_IN_HOUR, "lastCheck after download error"); |
563 test.equal(subscription.errors, 2, "errors after download error"); | 562 test.equal(subscription.errors, 2, "errors after download error"); |
564 }).catch(unexpectedError.bind(test)).then(() => test.done()); | 563 }).catch(unexpectedError.bind(test)).then(() => test.done()); |
565 }; | 564 }; |
LEFT | RIGHT |