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

Unified Diff: chrome/content/tests/synchronizer.js

Issue 6423769060999168: Issue 301 - adblockplustests: Use for (.. of ..) (Closed)
Patch Set: Created April 12, 2014, 1:48 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 | « chrome/content/tests/subscriptionClasses.js ('k') | chrome/content/tests/test_requestList.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/tests/synchronizer.js
===================================================================
--- a/chrome/content/tests/synchronizer.js
+++ b/chrome/content/tests/synchronizer.js
@@ -122,17 +122,17 @@
let tests = [
{header: "[Adblock]", downloadStatus: "synchronize_ok", requiredVersion: null},
{header: "[Adblock Plus]", downloadStatus: "synchronize_ok", requiredVersion: null},
{header: "(something)[Adblock]", downloadStatus: "synchronize_ok", requiredVersion: null},
{header: "[Adblock Plus 0.0.1]", downloadStatus: "synchronize_ok", requiredVersion: "0.0.1"},
{header: "[Adblock Plus 99.9]", downloadStatus: "synchronize_ok", requiredVersion: "99.9"},
{header: "[Foo]", downloadStatus: "synchronize_invalid_data", requiredVersion: null}
];
- for each (test in tests)
+ for (test of tests)
{
resetSubscription(subscription)
testRunner.runScheduledTasks(2);
equal(subscription.downloadStatus, test.downloadStatus, "Download status for " + test.header)
equal(subscription.requiredVersion, test.requiredVersion, "Required version for " + test.header)
if (test.downloadStatus == "synchronize_ok")
@@ -242,17 +242,17 @@
expiration: "40 hours",
randomResult: 0.5,
skipAfter: 5.1,
skip: 80, // Hitting hard expiration, immediate download
requests: [0.1, 85.1]
}
]
- for each (test in tests)
+ for (test of tests)
{
requests = [];
randomResult = test.randomResult;
resetSubscription(subscription);
let maxHours = Math.round(Math.max.apply(null, test.requests)) + 1;
testRunner.runScheduledTasks(maxHours, test.skipAfter, test.skip);
@@ -283,17 +283,17 @@
["Special comments are part of the checksum", "[Adblock]\n! Checksum: e/JCmqXny6Fn24b7JHsq/A\n! Expires: 1\nfoo\nbar\n", false],
];
testRunner.registerHandler("/subscription", function(metadata)
{
return [Cr.NS_OK, 200, subscriptionBody];
});
- for each ([testName, subscriptionBody, expectedResult] in tests)
+ for ([testName, subscriptionBody, expectedResult] of tests)
{
resetSubscription(subscription);
testRunner.runScheduledTasks(2);
equal(subscription.downloadStatus, expectedResult ? "synchronize_ok" : "synchronize_checksum_mismatch", testName);
}
});
test("Special comments", function()
@@ -313,17 +313,17 @@
["! Version: 1234", function() equal(subscription.version, 1234, "Version comment")]
];
testRunner.registerHandler("/subscription", function(metadata)
{
return [Cr.NS_OK, 200, "[Adblock]\n" + comment + "\nfoo\nbar"];
});
- for each([comment, check] in tests)
+ for ([comment, check] of tests)
{
resetSubscription(subscription);
testRunner.runScheduledTasks(2);
check();
deepEqual(subscription.filters, [Filter.fromText("foo"), Filter.fromText("bar")], "Special comment not added to filters");
}
});
« no previous file with comments | « chrome/content/tests/subscriptionClasses.js ('k') | chrome/content/tests/test_requestList.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld