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

Side by Side Diff: chrome/browser/profiles/profile_info_util_unittest.cc

Issue 8700014: Utility to draw GAIA pictures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/profile_info_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/profiles/profile_info_util.h"
6
7 #include "grit/generated_resources.h"
8 #include "grit/theme_resources.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/image/image_unittest_util.h"
12
13 namespace {
14
15 TEST(ProfileInfoUtilTest, MenuIcon) {
16 // Test that an avatar icon isn't changed.
17 const gfx::Image& profile_image(
18 ResourceBundle::GetSharedInstance().GetImageNamed(IDR_PROFILE_AVATAR_0));
19 gfx::Image result = profiles::GetAvatarIconForMenu(profile_image, false);
20 EXPECT_FALSE(gfx::test::IsEmpty(result));
21 EXPECT_TRUE(gfx::test::IsEqual(profile_image, result));
22
23 // Test that a GAIA picture is changed.
24 gfx::Image gaia_picture(gfx::test::CreateImage());
25 gfx::Image result2 = profiles::GetAvatarIconForMenu(gaia_picture, true);
26 EXPECT_FALSE(gfx::test::IsEmpty(result2));
27 EXPECT_FALSE(gfx::test::IsEqual(gaia_picture, result2));
28 }
29
30 TEST(ProfileInfoUtilTest, TitleBarIcon) {
31 // Test that an avatar icon isn't changed.
32 const gfx::Image& profile_image(
33 ResourceBundle::GetSharedInstance().GetImageNamed(IDR_PROFILE_AVATAR_0));
34 gfx::Image result = profiles::GetAvatarIconForTitleBar(
35 profile_image, false, 100, 40);
36 EXPECT_FALSE(gfx::test::IsEmpty(result));
37 EXPECT_TRUE(gfx::test::IsEqual(profile_image, result));
38
39 // Test that a GAIA picture is changed.
40 gfx::Image gaia_picture(gfx::test::CreateImage());
41 gfx::Image result2 = profiles::GetAvatarIconForTitleBar(
42 gaia_picture, true, 100, 40);
43 EXPECT_FALSE(gfx::test::IsEmpty(result2));
44 EXPECT_FALSE(gfx::test::IsEqual(gaia_picture, result2));
45 }
46
47 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_info_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698