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

Delta Between Two Patch Sets: qunit/tests/prefs.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Left Patch Set: Created Jan. 13, 2017, 12:11 p.m.
Right Patch Set: Addressed some more feedback Created Jan. 18, 2017, 11:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « qunit/tests/filterValidation.js ('k') | qunit/tests/url.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 "use strict";
2
1 { 3 {
2 module("Preferences", 4 module("Preferences",
3 { 5 {
4 setup: function() 6 setup()
5 { 7 {
6 preparePrefs.call(this); 8 preparePrefs.call(this);
7 }, 9 },
8 10
9 teardown: function() 11 teardown()
10 { 12 {
11 restorePrefs.call(this); 13 restorePrefs.call(this);
12 } 14 }
13 }); 15 });
14 16
15 function checkPrefExists(name, expectedValue, description, assert) 17 function checkPrefExists(name, expectedValue, description, assert)
16 { 18 {
17 let done = assert.async(); 19 let done = assert.async();
18 let key = "pref:" + name; 20 let key = "pref:" + name;
19 chrome.storage.local.get(key, items => 21 chrome.storage.local.get(key, items =>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 deepEqual(Prefs.notificationdata, {foo:1, bar: 2}, "Prefs object returns the correct value after setting pref to non-default value"); 94 deepEqual(Prefs.notificationdata, {foo:1, bar: 2}, "Prefs object returns the correct value after setting pref to non-default value");
93 checkPrefExists("notificationdata", true, "User-defined pref has been create d", assert); 95 checkPrefExists("notificationdata", true, "User-defined pref has been create d", assert);
94 checkPref("notificationdata", {foo:1, bar: 2}, "Value has been written", ass ert); 96 checkPref("notificationdata", {foo:1, bar: 2}, "Value has been written", ass ert);
95 97
96 delete Prefs.notificationdata.foo; 98 delete Prefs.notificationdata.foo;
97 delete Prefs.notificationdata.bar; 99 delete Prefs.notificationdata.bar;
98 Prefs.notificationdata = JSON.parse(JSON.stringify(Prefs.notificationdata)); 100 Prefs.notificationdata = JSON.parse(JSON.stringify(Prefs.notificationdata));
99 deepEqual(Prefs.notificationdata, {}, "Prefs object returns the correct valu e after setting pref to default value"); 101 deepEqual(Prefs.notificationdata, {}, "Prefs object returns the correct valu e after setting pref to default value");
100 }); 102 });
101 } 103 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld