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

Unified Diff: test/filterStorage_readwrite.js

Issue 29886685: Issue 6856 - Remove FilterStorage.moveSubscription (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created Sept. 20, 2018, 7:33 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/filterStorage_readwrite.js
===================================================================
--- a/test/filterStorage_readwrite.js
+++ b/test/filterStorage_readwrite.js
@@ -106,17 +106,17 @@
if (withExternal)
{
{
let subscription = new ExternalSubscription("~external~external subscription ID", "External subscription");
subscription.filters = [Filter.fromText("foo"), Filter.fromText("bar")];
FilterStorage.addSubscription(subscription);
}
- let externalSubscriptions = FilterStorage.subscriptions.filter(subscription => subscription instanceof ExternalSubscription);
+ let externalSubscriptions = [...FilterStorage.subscriptions()].filter(subscription => subscription instanceof ExternalSubscription);
test.equal(externalSubscriptions.length, 1, "Number of external subscriptions after updateExternalSubscription");
test.equal(externalSubscriptions[0].url, "~external~external subscription ID", "ID of external subscription");
test.equal(externalSubscriptions[0].filters.length, 2, "Number of filters in external subscription");
}
return FilterStorage.saveToDisk();
}).then(() => testData).then(expected =>
@@ -225,28 +225,28 @@
exports.testRestoringBackup = function(test)
{
Prefs.patternsbackups = 2;
Prefs.patternsbackupinterval = 24;
FilterStorage.saveToDisk().then(() =>
{
- test.equal(FilterStorage.subscriptions[0].filters.length, 1, "Initial filter count");
+ test.equal([...FilterStorage.subscriptions()][0].filters.length, 1, "Initial filter count");
FilterStorage.addFilter(Filter.fromText("barfoo"));
- test.equal(FilterStorage.subscriptions[0].filters.length, 2, "Filter count after adding a filter");
+ test.equal([...FilterStorage.subscriptions()][0].filters.length, 2, "Filter count after adding a filter");
return FilterStorage.saveToDisk();
}).then(() =>
{
return FilterStorage.loadFromDisk();
}).then(() =>
{
- test.equal(FilterStorage.subscriptions[0].filters.length, 2, "Filter count after adding filter and reloading");
+ test.equal([...FilterStorage.subscriptions()][0].filters.length, 2, "Filter count after adding filter and reloading");
return FilterStorage.restoreBackup(1);
}).then(() =>
{
- test.equal(FilterStorage.subscriptions[0].filters.length, 1, "Filter count after restoring backup");
+ test.equal([...FilterStorage.subscriptions()][0].filters.length, 1, "Filter count after restoring backup");
return FilterStorage.loadFromDisk();
}).then(() =>
{
- test.equal(FilterStorage.subscriptions[0].filters.length, 1, "Filter count after reloading");
+ test.equal([...FilterStorage.subscriptions()][0].filters.length, 1, "Filter count after reloading");
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
« lib/filterStorage.js ('K') | « test/filterStorage.js ('k') | test/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld