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); |
} |