Index: chrome/browser/profiles/profile_downloader_unittest.cc |
diff --git a/chrome/browser/profiles/profile_downloader_unittest.cc b/chrome/browser/profiles/profile_downloader_unittest.cc |
index c7c13121d69ce4a331d2d9c15ee1c6757935b9cb..3761c77ef2a8cbf0057de3d9198cc4930f975c9a 100644 |
--- a/chrome/browser/profiles/profile_downloader_unittest.cc |
+++ b/chrome/browser/profiles/profile_downloader_unittest.cc |
@@ -4,31 +4,38 @@ |
#include "chrome/browser/profiles/profile_downloader.h" |
-#include "base/json/json_reader.h" |
-#include "base/memory/scoped_ptr.h" |
-#include "base/strings/string_piece.h" |
#include "base/strings/utf_string_conversions.h" |
-#include "base/values.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace { |
-void GetJSonData(const std::string& full_name, |
- const std::string& given_name, |
- const std::string& url, |
- const std::string& locale, |
- base::DictionaryValue* dict) { |
- if (!full_name.empty()) |
- dict->SetString("displayName", full_name); |
+std::string GetJSonData(const std::string& full_name, |
+ const std::string& given_name, |
+ const std::string& url, |
+ const std::string& locale) { |
+ std::stringstream stream; |
+ bool started = false; |
- if (!given_name.empty()) |
- dict->SetString("name.givenName", given_name); |
- |
- if (!url.empty()) |
- dict->SetString("image.url", url); |
+ stream << "{ "; |
+ if (!full_name.empty()) { |
+ stream << "\"name\": \"" << full_name << "\""; |
+ started = true; |
+ } |
+ if (!given_name.empty()) { |
+ stream << (started ? ", " : "") << "\"given_name\": \"" << given_name |
+ << "\""; |
+ started = true; |
+ } |
+ if (!url.empty()) { |
+ stream << (started ? ", " : "") << "\"picture\": \"" << url << "\""; |
+ started = true; |
+ } |
if (!locale.empty()) |
- dict->SetString("language", locale); |
+ stream << (started ? ", " : "") << "\"locale\": \"" << locale << "\""; |
+ |
+ stream << " }"; |
+ return stream.str(); |
} |
} // namespace |
@@ -51,10 +58,8 @@ |
base::string16 parsed_given_name; |
std::string parsed_url; |
std::string parsed_locale; |
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
- GetJSonData(full_name, given_name, url, locale, dict.get()); |
bool result = ProfileDownloader::ParseProfileJSON( |
- dict.get(), |
+ GetJSonData(full_name, given_name, url, locale), |
&parsed_full_name, |
&parsed_given_name, |
&parsed_url, |