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

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

Issue 2340653002: [Material][Mac] Update the User Account Button (Closed)
Patch Set: removed the build file 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
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 26572c6e2fb2308e3c3c8600457e1a52e9aa9fb6..2b765e50eea4aa2bd4221dffbc8487ae0ada2629 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller_unittest.mm
@@ -22,6 +22,7 @@
#include "grit/theme_resources.h"
#import "testing/gtest_mac.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
// Defined in the AvatarButtonController implementation.
@@ -107,9 +108,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/user_account_avatar.icon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698