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

Unified Diff: chrome/content/tests/notification.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/matcher.js ('k') | chrome/content/tests/performance/common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/tests/notification.js
===================================================================
--- a/chrome/content/tests/notification.js
+++ b/chrome/content/tests/notification.js
@@ -172,17 +172,17 @@
["platformMinVersion", "13", false],
["platformMinVersion", "12.1", false],
["platformMaxVersion", "12.0", true],
["platformMaxVersion", "12", true],
["platformMaxVersion", "13", true],
["platformMaxVersion", "11", false],
];
- for each (let [propName, value, result] in targets)
+ for (let [propName, value, result] of targets)
{
let targetInfo = {};
targetInfo[propName] = value;
let information = fixConstructors({
id: 1,
type: "information",
message: {"en-US": "Information"},
@@ -195,18 +195,18 @@
let expected = (result ? information : null);
deepEqual(Notification.getNextToShow(), expected, "Selected notification for " + JSON.stringify(information.targets));
deepEqual(Notification.getNextToShow(), null, "No notification on second call");
}
function pairs(array)
{
- for each (let element1 in array)
- for each (let element2 in array)
+ for (let element1 of array)
+ for (let element2 of array)
yield [element1, element2];
}
for (let [[propName1, value1, result1], [propName2, value2, result2]] in pairs(targets))
{
let targetInfo1 = {};
targetInfo1[propName1] = value1;
let targetInfo2 = {};
targetInfo2[propName2] = value2;
@@ -298,17 +298,17 @@
skipAfter: 5.2,
skip: 30, // Long break should increase soft expiration, hitting hard expiration
requests: [0.2, 48.2]
}
];
let requests = [];
registerHandler([], function(metadata) requests.push(testRunner.getTimeOffset()));
- for each (let test in tests)
+ for (let test of tests)
{
Prefs.notificationdata = {};
requests = [];
randomResult = test.randomResult;
let maxHours = Math.round(Math.max.apply(null, test.requests)) + 1;
testRunner.runScheduledTasks(maxHours, test.skipAfter, test.skip);
« no previous file with comments | « chrome/content/tests/matcher.js ('k') | chrome/content/tests/performance/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld