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: Allow tests to be run from different directory Created Oct. 3, 2016, 6:01 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') | no next file with comments »
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..8e54fbf7fd726e72dbbdc3c2b6b1fc623d2d9f84 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("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') | no next file with comments »

Powered by Google App Engine
This is Rietveld