Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: test/synchronizer.js

Issue 29356001: Issue 4223 - Adapt notification tests to work in adblockpluscore repository (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Created Oct. 5, 2016, 12:32 p.m.
Right Patch Set: Addressed comments Created Oct. 5, 2016, 12:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/stub-modules/prefs.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld