Chromium Code Reviews| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm |
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm |
| index cf4f54a292b446effeab4c03b17cbae1b31aa9eb..a932f54c6d1b199b66c884daad6655927f5a884a 100644 |
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm |
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm |
| @@ -26,6 +26,7 @@ |
| #include "testing/gtest/include/gtest/gtest.h" |
| #import "testing/gtest_mac.h" |
| #include "testing/platform_test.h" |
| +#include "ui/base/material_design/material_design_controller.h" |
| using base::ASCIIToUTF16; |
| using bookmarks::BookmarkBubbleObserver; |
| @@ -122,13 +123,19 @@ int BookmarkBubbleControllerTest::edits_; |
| // Confirm basics about the bubble window (e.g. that it is inside the |
| // parent window) |
|
Avi (use Gerrit)
2016/05/05 02:04:48
This comment seems not true any more.
shrike
2016/05/05 17:44:03
Fixed.
|
| TEST_F(BookmarkBubbleControllerTest, TestBubbleWindow) { |
| + EXPECT_TRUE(ui::MaterialDesignController::IsModeMaterial()); |
|
Avi (use Gerrit)
2016/05/05 02:04:48
I don't understand this line; this would make the
shrike
2016/05/05 17:44:03
Thank you for catching that - that should not have
|
| const BookmarkNode* node = CreateTestBookmark(); |
| BookmarkBubbleController* controller = ControllerForNode(node); |
| EXPECT_TRUE(controller); |
| NSWindow* window = [controller window]; |
| EXPECT_TRUE(window); |
| - EXPECT_TRUE(NSContainsRect([browser()->window()->GetNativeWindow() frame], |
| - [window frame])); |
| + NSRect browser_window_frame = [browser()->window()->GetNativeWindow() frame]; |
| + // The metrics have changed slightly under Material Design, so that in this |
| + // test case the bookmarks bubble is slightly outside of the window. |
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
| + browser_window_frame.size.width += 1; |
| + } |
| + EXPECT_TRUE(NSContainsRect(browser_window_frame, [window frame])); |
| } |
| // Test that we can handle closing the parent window |