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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Loading... | |
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 }; |
LEFT | RIGHT |