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

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: Remove test code, update comments. 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..c91486867fc7d5300ddd8b2c540978c4051e820a 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;
@@ -119,16 +120,22 @@ class BookmarkBubbleControllerTest : public CocoaProfileTest {
// static
int BookmarkBubbleControllerTest::edits_;
-// Confirm basics about the bubble window (e.g. that it is inside the
-// parent window)
+// Confirm basics about the bubble window (e.g. that its frame fits inside, or
+// almost completely fits inside, its parent window's frame).
TEST_F(BookmarkBubbleControllerTest, TestBubbleWindow) {
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's window frame extendeds slightly beyond its
+ // parent window's frame.
+ 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