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

Unified Diff: qunit/tests/prefs.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Use const as per the new rules Created Jan. 18, 2017, 7:23 a.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 | « qunit/tests/filterValidation.js ('k') | qunit/tests/url.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: qunit/tests/prefs.js
diff --git a/qunit/tests/prefs.js b/qunit/tests/prefs.js
index f620ca9a555056d0a53856fb805a0cc64120011a..5430c8b2eb7ab123a1d9b84e41224c1bc8ac5629 100644
--- a/qunit/tests/prefs.js
+++ b/qunit/tests/prefs.js
@@ -1,13 +1,14 @@
-(function()
+"use strict";
+
{
module("Preferences",
{
- setup: function()
+ setup()
{
preparePrefs.call(this);
},
- teardown: function()
+ teardown()
{
restorePrefs.call(this);
}
@@ -17,7 +18,7 @@
{
let done = assert.async();
let key = "pref:" + name;
- chrome.storage.local.get(key, function(items)
+ chrome.storage.local.get(key, items =>
{
equal(key in items, expectedValue, description);
done();
@@ -28,14 +29,14 @@
{
let done = assert.async();
let key = "pref:" + name;
- chrome.storage.local.get(key, function(items)
+ chrome.storage.local.get(key, items =>
{
deepEqual(items[key], expectedValue, description);
done();
});
}
- test("Numerical pref", function(assert)
+ test("Numerical pref", assert =>
{
Prefs.patternsbackups = 5;
equal(Prefs.patternsbackups, 5, "Prefs object returns the correct value after setting pref to default value");
@@ -46,7 +47,7 @@
checkPref("patternsbackups", 12, "Value has been written", assert);
});
- test("Boolean pref", function(assert)
+ test("Boolean pref", assert =>
{
Prefs.enabled = true;
equal(Prefs.enabled, true, "Prefs object returns the correct value after setting pref to default value");
@@ -57,7 +58,7 @@
checkPref("enabled", false, "Value has been written", assert);
});
- test("String pref", function(assert)
+ test("String pref", assert =>
{
let defaultValue = "https://notification.adblockplus.org/notification.json";
Prefs.notificationurl = defaultValue;
@@ -71,7 +72,7 @@
checkPref("notificationurl", newValue, "Value has been written", assert);
});
- test("Object pref (complete replacement)", function(assert)
+ test("Object pref (complete replacement)", assert =>
{
Prefs.notificationdata = {};
deepEqual(Prefs.notificationdata, {}, "Prefs object returns the correct value after setting pref to default value");
@@ -83,7 +84,7 @@
checkPref("notificationdata", newValue, "Value has been written", assert);
});
- test("Property-wise modification", function(assert)
+ test("Property-wise modification", assert =>
{
Prefs.notificationdata = {};
@@ -99,4 +100,4 @@
Prefs.notificationdata = JSON.parse(JSON.stringify(Prefs.notificationdata));
deepEqual(Prefs.notificationdata, {}, "Prefs object returns the correct value after setting pref to default value");
});
-})();
+}
« no previous file with comments | « qunit/tests/filterValidation.js ('k') | qunit/tests/url.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld