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

Side by Side Diff: test/filterStorage.js

Issue 29616611: Issue 6090 - Allow use of console to be seen during tests (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Nov. 23, 2017, 7:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« test/_common.js ('K') | « test/_common.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 "use strict"; 18 "use strict";
19 19
20 const {createSandbox} = require("./_common"); 20 const {createSandbox, maybeExpectError} = require("./_common");
21 21
22 let Filter = null; 22 let Filter = null;
23 let FilterNotifier = null; 23 let FilterNotifier = null;
24 let FilterStorage = null; 24 let FilterStorage = null;
25 let Subscription = null; 25 let Subscription = null;
26 26
27 exports.setUp = function(callback) 27 exports.setUp = function(callback)
28 { 28 {
29 let sandboxedRequire = createSandbox(); 29 let sandboxedRequire = createSandbox();
30 30
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 FilterStorage.removeSubscription(subscription2); 178 FilterStorage.removeSubscription(subscription2);
179 compareSubscriptionList(test, "Remove", [subscription3, subscription1]); 179 compareSubscriptionList(test, "Remove", [subscription3, subscription1]);
180 180
181 changes = []; 181 changes = [];
182 test.ok(FilterStorage.moveSubscription(subscription3, subscription2), "Move be fore removed subscription succeeded"); 182 test.ok(FilterStorage.moveSubscription(subscription3, subscription2), "Move be fore removed subscription succeeded");
183 compareSubscriptionList(test, "Move before removed subscription", [subscriptio n1, subscription3]); 183 compareSubscriptionList(test, "Move before removed subscription", [subscriptio n1, subscription3]);
184 test.deepEqual(changes, ["subscription.moved http://test3/"], "Received change s"); 184 test.deepEqual(changes, ["subscription.moved http://test3/"], "Received change s");
185 185
186 changes = []; 186 changes = [];
187 test.ok(!FilterStorage.moveSubscription(subscription2), "Move of removed subsc ription failed"); 187 maybeExpectError(
188 "Attempt to move a subscription that is not in the list",
189 () => test.ok(!FilterStorage.moveSubscription(subscription2), "Move of remov ed subscription failed")
sergei 2017/11/24 10:15:28 What about being more strict and wrap only the cal
hub 2017/11/24 15:48:59 Done.
190 );
188 compareSubscriptionList(test, "Move of removed subscription", [subscription1, subscription3]); 191 compareSubscriptionList(test, "Move of removed subscription", [subscription1, subscription3]);
189 test.deepEqual(changes, [], "Received changes"); 192 test.deepEqual(changes, [], "Received changes");
190 193
191 subscription1.delete(); 194 subscription1.delete();
192 subscription2.delete(); 195 subscription2.delete();
193 subscription3.delete(); 196 subscription3.delete();
194 197
195 test.done(); 198 test.done();
196 }; 199 };
197 200
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 "filter.removed foo 2 1" 297 "filter.removed foo 2 1"
295 ], "Received changes"); 298 ], "Received changes");
296 299
297 changes = []; 300 changes = [];
298 removeFilter("foo"); 301 removeFilter("foo");
299 compareFiltersList(test, "Removing unknown filter", [[], ["@@bar", "foo##bar", "foo#@#bar"], ["!foobar"]]); 302 compareFiltersList(test, "Removing unknown filter", [[], ["@@bar", "foo##bar", "foo#@#bar"], ["!foobar"]]);
300 test.deepEqual(changes, [], "Received changes"); 303 test.deepEqual(changes, [], "Received changes");
301 304
302 test.done(); 305 test.done();
303 }; 306 };
OLDNEW
« test/_common.js ('K') | « test/_common.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld