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

Unified Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 291043002: identity.getAccounts should return one array instead of multiple AccountInfos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/browser/extensions/api/identity/identity_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/identity_apitest.cc
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index 942e66351ac8ee78b81e11a9262ca7543422b374..7948a13d0274c50b6b27922be7660e2332b05c4a 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -379,9 +379,18 @@ class IdentityGetAccountsFunctionTest : public ExtensionBrowserTest {
return GenerateFailureResult(accounts, NULL)
<< "getAccounts did not return a result.";
}
- const base::ListValue* results = func->GetResultList();
- if (!results || (results->GetSize() != accounts.size()))
- return GenerateFailureResult(accounts, results);
+ const base::ListValue* callback_arguments = func->GetResultList();
+ if (!callback_arguments)
+ return GenerateFailureResult(accounts, NULL) << "NULL result";
+
+ if (callback_arguments->GetSize() != 1) {
+ return GenerateFailureResult(accounts, NULL)
+ << "Expected 1 argument but got " << callback_arguments->GetSize();
+ }
+
+ const base::ListValue* results;
+ if (!callback_arguments->GetList(0, &results))
+ GenerateFailureResult(accounts, NULL) << "Result was not an array";
std::set<std::string> result_ids;
for (base::ListValue::const_iterator it = results->begin();
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698