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

Delta Between Two Patch Sets: test/filterStorage_readwrite.js

Issue 29402582: Issue 5098 - Expose FilterStorage initialization state (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Created April 4, 2017, 12:51 p.m.
Right Patch Set: Fixed description Created April 5, 2017, 7:16 a.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 | « lib/filterStorage.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-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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return 1; 103 return 1;
104 return 0; 104 return 0;
105 }); 105 });
106 return sections.map( 106 return sections.map(
107 section => [section.header].concat(section.data).join("\n") 107 section => [section.header].concat(section.data).join("\n")
108 ).join("\n"); 108 ).join("\n");
109 } 109 }
110 110
111 function testReadWrite(test, withExternal) 111 function testReadWrite(test, withExternal)
112 { 112 {
113 test.ok(!FilterStorage.initialized, "Not initialize before the first load"); 113 test.ok(!FilterStorage.initialized, "Uninitialized before the first load");
kzar 2017/04/05 03:51:11 Nit: Should be "Uninitiated before...".
Wladimir Palant 2017/04/05 07:16:28 Done.
114 114
115 return testData.then(data => 115 return testData.then(data =>
116 { 116 {
117 dataFile.contents = data; 117 dataFile.contents = data;
118 return loadFilters(); 118 return loadFilters();
119 }).then(() => 119 }).then(() =>
120 { 120 {
121 test.ok(FilterStorage.initialized, "Initialize after the first load"); 121 test.ok(FilterStorage.initialized, "Initialize after the first load");
122 test.equal(FilterStorage.fileProperties.version, FilterStorage.formatVersion , "File format version"); 122 test.equal(FilterStorage.fileProperties.version, FilterStorage.formatVersion , "File format version");
123 123
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return FilterStorage.restoreBackup(1); 324 return FilterStorage.restoreBackup(1);
325 }).then(() => 325 }).then(() =>
326 { 326 {
327 test.equal(FilterStorage.subscriptions.length, 1, "Subscription count after restoring backup"); 327 test.equal(FilterStorage.subscriptions.length, 1, "Subscription count after restoring backup");
328 return loadFilters(); 328 return loadFilters();
329 }).then(() => 329 }).then(() =>
330 { 330 {
331 test.equal(FilterStorage.subscriptions.length, 1, "Subscription count after reloading"); 331 test.equal(FilterStorage.subscriptions.length, 1, "Subscription count after reloading");
332 }).catch(unexpectedError.bind(test)).then(() => test.done()); 332 }).catch(unexpectedError.bind(test)).then(() => test.done());
333 }; 333 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld