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

Unified Diff: chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm

Issue 1951033003: [Mac][Material Design] Fix SelectedKeywordDecoration tests for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add documentation. Created 4 years, 7 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/location_bar/selected_keyword_decoration.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm
index ddb5682991aea29e3b0cf479e1d176bb139ebaec..4dee6de9f954b9db6bede297a0021dd03d202513 100644
--- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm
@@ -9,6 +9,10 @@
#import "chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
+#include "ui/base/material_design/material_design_controller.h"
+#include "ui/gfx/image/image_skia_util_mac.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
namespace {
@@ -23,6 +27,16 @@ const CGFloat kNarrowWidth(5.0);
class SelectedKeywordDecorationTest : public CocoaTest {
public:
SelectedKeywordDecorationTest() {
+ // With Material Design vector images the image isn't set at creation time
+ // but later by the LocationBar. The unit tests fail with a nil image, so
+ // initialize it now.
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ const int kDefaultIconSize = 16;
+ decoration_.SetImage(NSImageFromImageSkia(
+ gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH,
+ kDefaultIconSize,
+ SK_ColorBLACK)));
+ }
}
SelectedKeywordDecoration decoration_;
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698