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

Unified Diff: test/filterStorage_readwrite.js

Issue 29416573: Issue 5153 - Simplify patterns.ini parsing (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created April 18, 2017, 1: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
« no previous file with comments | « test/filterStorage.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterStorage_readwrite.js
===================================================================
--- a/test/filterStorage_readwrite.js
+++ b/test/filterStorage_readwrite.js
@@ -131,81 +131,16 @@ exports.testReadAndSaveToFile = function
testReadWrite(test, false);
};
exports.testReadAndSaveToFileWithExternalSubscription = function(test)
{
testReadWrite(test, true);
};
-exports.testLegacyGroups = {};
-
-for (let url of ["~wl~", "~fl~", "~eh~"])
-{
- exports.testLegacyGroups["read empty " + url] = function(test)
- {
- IO._setFileContents(FilterStorage.sourceFile, [
- "[Subscription]", "url=" + url
- ]);
-
- FilterStorage.loadFromDisk().then(() =>
- {
- test.equal(FilterStorage.subscriptions.length, 0, "Number of filter subscriptions");
- }).catch(unexpectedError.bind(test)).then(() => test.done());
- };
-
- exports.testLegacyGroups["read non-empty " + url] = function(test)
- {
- IO._setFileContents(FilterStorage.sourceFile, [
- "[Subscription]", "url=" + url,
- "[Subscription filters]", "foo"
- ]);
-
- FilterStorage.loadFromDisk().then(() =>
- {
- test.equal(FilterStorage.subscriptions.length, 1, "Number of filter subscriptions");
- if (FilterStorage.subscriptions.length == 1)
- {
- let subscription = FilterStorage.subscriptions[0];
- test.equal(subscription.url, url, "Subscription ID");
- test.equal(subscription.title, null, "Subscription title");
- test.deepEqual(subscription.defaults, null, "Default types");
- test.equal(subscription.filters.length, 1, "Number of subscription filters");
- if (subscription.filters.length == 1)
- test.equal(subscription.filters[0].text, "foo", "First filter");
- }
- }).catch(unexpectedError.bind(test)).then(() => test.done());
- };
-}
-
-exports.testReadLegacyFilters = function(test)
-{
- IO._setFileContents(FilterStorage.sourceFile, [
- "[Subscription]", "url=~user~1234", "title=Foo",
- "[Subscription filters]",
- "[User patterns]", "foo", "\\[bar]", "foo#bar"
- ]);
-
- FilterStorage.loadFromDisk().then(() =>
- {
- test.equal(FilterStorage.subscriptions.length, 1, "Number of filter subscriptions");
- if (FilterStorage.subscriptions.length == 1)
- {
- let subscription = FilterStorage.subscriptions[0];
- test.equal(subscription.filters.length, 3, "Number of subscription filters");
- if (subscription.filters.length == 3)
- {
- test.equal(subscription.filters[0].text, "foo", "First filter");
- test.equal(subscription.filters[1].text, "[bar]", "Second filter");
- test.equal(subscription.filters[2].text, "foo#bar", "Third filter");
- }
- }
- }).catch(unexpectedError.bind(test)).then(() => test.done());
-};
-
exports.testImportExport = function(test)
{
testData.then(lines =>
{
if (lines.length && lines[lines.length - 1] == "")
lines.pop();
let importer = FilterStorage.importData();
« no previous file with comments | « test/filterStorage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld