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

Side by Side Diff: chrome/content/tests/subscriptionClasses.js

Issue 6423769060999168: Issue 301 - adblockplustests: Use for (.. of ..) (Closed)
Patch Set: Created April 12, 2014, 1:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/tests/popupBlocker.js ('k') | chrome/content/tests/synchronizer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 (function() 1 (function()
2 { 2 {
3 module("Subscription classes", {setup: prepareFilterComponents, teardown: rest oreFilterComponents}); 3 module("Subscription classes", {setup: prepareFilterComponents, teardown: rest oreFilterComponents});
4 4
5 function compareSubscription(url, expected, postInit) 5 function compareSubscription(url, expected, postInit)
6 { 6 {
7 expected.push("[Subscription]") 7 expected.push("[Subscription]")
8 let subscription = Subscription.fromURL(url); 8 let subscription = Subscription.fromURL(url);
9 if (postInit) 9 if (postInit)
10 postInit(subscription) 10 postInit(subscription)
11 let result = []; 11 let result = [];
12 subscription.serialize(result); 12 subscription.serialize(result);
13 equal(result.sort().join("\n"), expected.sort().join("\n"), url); 13 equal(result.sort().join("\n"), expected.sort().join("\n"), url);
14 14
15 let map = {__proto__: null}; 15 let map = {__proto__: null};
16 for each (let line in result.slice(1)) 16 for (let line of result.slice(1))
17 { 17 {
18 if (/(.*?)=(.*)/.test(line)) 18 if (/(.*?)=(.*)/.test(line))
19 map[RegExp.$1] = RegExp.$2; 19 map[RegExp.$1] = RegExp.$2;
20 } 20 }
21 let subscription2 = Subscription.fromObject(map); 21 let subscription2 = Subscription.fromObject(map);
22 equal(subscription.toString(), subscription2.toString(), url + " deserializa tion"); 22 equal(subscription.toString(), subscription2.toString(), url + " deserializa tion");
23 } 23 }
24 24
25 test("Subscription class definitions", function() 25 test("Subscription class definitions", function()
26 { 26 {
(...skipping 28 matching lines...) Expand all
55 subscription.version = 24 55 subscription.version = 24
56 subscription.requiredVersion = "0.6"; 56 subscription.requiredVersion = "0.6";
57 }); 57 });
58 compareSubscription("~wl~", ["url=~wl~", "disabled=true", "title=Test group" ], function(subscription) 58 compareSubscription("~wl~", ["url=~wl~", "disabled=true", "title=Test group" ], function(subscription)
59 { 59 {
60 subscription.title = "Test group"; 60 subscription.title = "Test group";
61 subscription.disabled = true; 61 subscription.disabled = true;
62 }); 62 });
63 }); 63 });
64 })(); 64 })();
OLDNEW
« no previous file with comments | « chrome/content/tests/popupBlocker.js ('k') | chrome/content/tests/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld