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

Unified Diff: chrome/test/data/extensions/api_test/autofill_private/test.js

Issue 2028903002: Update Autofill Private API to provide a list of available countries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 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
Index: chrome/test/data/extensions/api_test/autofill_private/test.js
diff --git a/chrome/test/data/extensions/api_test/autofill_private/test.js b/chrome/test/data/extensions/api_test/autofill_private/test.js
index bc4b9ee1394ae681f1cb16cb3e571be71d67a6aa..884e0447e74a02fb70dbcd09abf1a860abf87e01 100644
--- a/chrome/test/data/extensions/api_test/autofill_private/test.js
+++ b/chrome/test/data/extensions/api_test/autofill_private/test.js
@@ -29,6 +29,43 @@ var availableTests = [
chrome.autofillPrivate.saveAddress({fullNames: [NAME]});
},
+ function getCountryList() {
+ var handler = function(countries) {
+ var numSeparators = 0;
+ var countBeforeSeparator = 0;
+ var countAfterSeparator = 0;
+
+ var beforeSeparator = true;
+
+ chrome.test.assertTrue(countries.length > 1,
+ 'Expected more than one country');
+
+ countries.forEach(function(country) {
+ // Expecting to have both |name| and |countryCode| or neither.
+ chrome.test.assertEq(!!country.name, !!country.countryCode);
+
+ if (country.name) {
+ if (beforeSeparator)
+ ++countBeforeSeparator;
+ else
+ ++countAfterSeparator;
+ } else {
+ beforeSeparator = false;
+ ++numSeparators;
+ }
+ });
+
+ chrome.test.assertEq(1, numSeparators);
+ chrome.test.assertEq(1, countBeforeSeparator);
+ chrome.test.assertTrue(countAfterSeparator > 1,
+ 'Expected more than one country after the separator');
+
+ chrome.test.succeed();
+ };
+
+ chrome.autofillPrivate.getCountryList(handler);
+ },
+
function getAddressComponents() {
var COUNTRY_CODE = 'US';
« no previous file with comments | « chrome/common/extensions/api/autofill_private.idl ('k') | extensions/browser/extension_function_histogram_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698