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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm

Issue 2286993002: [Material][Mac] Update the User Account Button (Closed)
Patch Set: fixed test Created 4 years, 3 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/cocoa/profiles/avatar_button_controller.mm ('k') | ui/gfx/vector_icons/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
index da9d6bf5c0ae36a0e3329c93582e148b1a5380eb..74cd092525ac5e891d5efa74f953104059a9468a 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
@@ -21,6 +21,7 @@
#include "chrome/grit/theme_resources.h"
#include "components/signin/core/common/profile_management_switches.h"
#import "testing/gtest_mac.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
// Defined in the AvatarButtonController implementation.
@@ -106,9 +107,15 @@ TEST_F(AvatarButtonControllerTest, ProfileButtonWithErrorShown) {
ASSERT_FALSE([view() isHidden]);
EXPECT_NSEQ(@"Person 1", [button() title]);
- // If the button has an authentication error, it should display an error icon.
- int errorWidth = ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
- IDR_ICON_PROFILES_AVATAR_BUTTON_ERROR).Width();
+ // If the button has an authentication error, it should display an error
+ // icon. If in the MD, the icon size should be 16.
+ int errorWidth =
+ ui::MaterialDesignController::IsModeMaterial()
+ ? 16
+ : ui::ResourceBundle::GetSharedInstance()
+ .GetNativeImageNamed(IDR_ICON_PROFILES_AVATAR_BUTTON_ERROR)
+ .Width();
+
EXPECT_EQ(errorWidth, [button() image].size.width);
}
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm ('k') | ui/gfx/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698