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

Unified Diff: test/subscriptionClasses.js

Issue 29354864: Issue 4223 - Migrate some more of adblockplustests (Closed)
Patch Set: Addressed feedback Created Oct. 4, 2016, 12:04 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/stub-modules/prefs.js ('k') | test_runner.js » ('j') | test_runner.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/subscriptionClasses.js
diff --git a/test/subscriptionClasses.js b/test/subscriptionClasses.js
index 16e793350891ef91d28efff6cae5328111792ade..61767551aba879ccfde595c3774c9067af0d2997 100644
--- a/test/subscriptionClasses.js
+++ b/test/subscriptionClasses.js
@@ -17,17 +17,32 @@
"use strict";
-let {
- Subscription, SpecialSubscription, DownloadableSubscription,
- RegularSubscription, ExternalSubscription
-} = require("../lib/subscriptionClasses");
+let {createSandbox} = require("./_common");
+
+let Subscription = null;
+let SpecialSubscription = null;
+let DownloadableSubscription = null;
+let RegularSubscription = null;
+let ExternalSubscription = null;
+
+exports.setUp = function(callback)
+{
+ let sandboxedRequire = createSandbox();
+ (
+ {Subscription, SpecialSubscription,
+ DownloadableSubscription, RegularSubscription,
+ ExternalSubscription} = sandboxedRequire("../lib/subscriptionClasses")
+ );
+
+ callback();
+};
function compareSubscription(test, url, expected, postInit)
{
- expected.push("[Subscription]")
+ expected.push("[Subscription]");
let subscription = Subscription.fromURL(url);
if (postInit)
- postInit(subscription)
+ postInit(subscription);
let result = [];
subscription.serialize(result);
test.equal(result.sort().join("\n"), expected.sort().join("\n"), url);
@@ -74,7 +89,7 @@ exports.testSubscriptionsWithState = function(test)
subscription.expires = 20;
subscription.downloadStatus = "foo";
subscription.errors = 3;
- subscription.version = 24
+ subscription.version = 24;
subscription.requiredVersion = "0.6";
});
compareSubscription(test, "~wl~", ["url=~wl~", "disabled=true", "title=Test group"], function(subscription)
« no previous file with comments | « test/stub-modules/prefs.js ('k') | test_runner.js » ('j') | test_runner.js » ('J')

Powered by Google App Engine
This is Rietveld