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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc

Issue 2807373003: MD Settings: get the avatar icon the same way the user switcher does (Closed)
Patch Set: dschuyler@ review Created 3 years, 8 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/ui/webui/settings/profile_info_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc b/chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc
index f94e03c78ec7b227c93b360e2e3fb52012b26ecb..94a0b45ff9c70e01ae5def295904c1df0fb30706 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc
+++ b/chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc
@@ -14,7 +14,11 @@
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_web_ui.h"
+#include "net/base/data_url.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/codec/png_codec.h"
+#include "url/gurl.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
@@ -78,7 +82,15 @@ class ProfileInfoHandlerTest : public testing::Test {
EXPECT_FALSE(icon_url.empty());
#else
EXPECT_EQ("Profile 1", name);
- EXPECT_EQ("chrome://theme/IDR_PROFILE_AVATAR_0", icon_url);
+
+ std::string mime, charset, data;
+ EXPECT_TRUE(net::DataURL::Parse(GURL(icon_url), &mime, &charset, &data));
+
+ EXPECT_EQ("image/png", mime);
+ SkBitmap bitmap;
+ EXPECT_TRUE(gfx::PNGCodec::Decode(
+ reinterpret_cast<const unsigned char*>(data.data()), data.size(),
+ &bitmap));
#endif
}
« no previous file with comments | « chrome/browser/ui/webui/settings/profile_info_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698