Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3910)

Unified Diff: chrome/test/data/extensions/api_test/chromeos_info_private/background.html

Issue 6995105: Expose initial_locale via chrome.chromeosInfoPrivate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use initial locale from settings Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/chromeos_info_private/background.html
diff --git a/chrome/test/data/extensions/api_test/chromeos_info_private/background.html b/chrome/test/data/extensions/api_test/chromeos_info_private/background.html
index 76d8b786c3253fbfe9d8f8ebdc88c5aad10aeee2..df0862174b9108c82ea1f0b364b403fa8f47666d 100644
--- a/chrome/test/data/extensions/api_test/chromeos_info_private/background.html
+++ b/chrome/test/data/extensions/api_test/chromeos_info_private/background.html
@@ -5,16 +5,27 @@
function getTestFunctionFor(keys, fails) {
return function generatedTest () {
// Debug.
- console.log("keys: " + keys + ", fails: " + fails);
+ console.log("keys: " + keys + "; fails: " + fails);
chrome.chromeosInfoPrivate.get(
keys,
- pass(function(values) {
- // Debug
- console.log("values: ", values);
- for (var i = 0; i < keys.length; ++i)
- chrome.test.assertEq(!(i in fails), keys[i] in values);
- }));
+ pass(
+ function(values) {
+ for (var i = 0; i < keys.length; ++i) {
+ // Debug
+ if (keys[i] in values) {
+ console.log(" values['" + keys[i] + "'] = " +
+ values[keys[i]]);
+ } else {
+ console.log(" " + keys[i] + " is missing in values");
+ }
+
+ chrome.test.assertEq(fails.indexOf(keys[i]) == -1,
+ keys[i] in values);
+ }
+ }
+ )
+ );
}
}
@@ -25,8 +36,8 @@
// Test with all the keys at one.
tests.push(getTestFunctionFor(keys, []));
// Tests with key which hasn't corresponding value.
- var noValueKey = "no-value-for-this-key";
- tests.push(getTestFunctionFor([noValueKey], [0]));
+ var noValueKey = "noValueForThisKey";
+ tests.push(getTestFunctionFor([noValueKey], [noValueKey]));
if (keys.length > 1) {
// Tests with the separate keys.
@@ -34,13 +45,14 @@
tests.push(getTestFunctionFor([keys[i]], []));
}
}
- if (keys.length > 2) {
+ if (keys.length >= 2) {
tests.push(getTestFunctionFor([keys[0], keys[1]], []));
- tests.push(getTestFunctionFor([keys[0], noValueKey, keys[1]], [1]));
+ tests.push(getTestFunctionFor([keys[0], noValueKey, keys[1]],
+ [noValueKey]));
}
return tests;
}
- var tests = generateTestsForKeys(["hwid", "homeProvider"])
+ var tests = generateTestsForKeys(["hwid", "homeProvider", "initialLocale"])
chrome.test.runTests(tests);
</script>
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698