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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm

Issue 1952893002: [Mac][Material Design] Fix BookmarkBubbleControllerTest.TestBubbleWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698