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

Unified Diff: chrome/browser/cocoa/status_bubble_mac_unittest.mm

Issue 3041028: [Mac] Reposition the status bubble whenever adding it to a window.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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/cocoa/status_bubble_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/status_bubble_mac_unittest.mm
===================================================================
--- chrome/browser/cocoa/status_bubble_mac_unittest.mm (revision 54099)
+++ chrome/browser/cocoa/status_bubble_mac_unittest.mm (working copy)
@@ -458,3 +458,23 @@
EXPECT_NE(rect_before.size.width, rect_after.size.width);
EXPECT_EQ(rect_before.size.height, rect_after.size.height);
}
+
+TEST_F(StatusBubbleMacTest, MovingWindowUpdatesPosition) {
+ NSWindow* window = test_window();
+
+ // Show the bubble and make sure it has the same origin as |window|.
+ bubble_->SetStatus(L"Showing");
+ NSWindow* child = GetWindow();
+ EXPECT_TRUE(NSEqualPoints([window frame].origin, [child frame].origin));
+
+ // Hide the bubble, move the window, and show it again.
+ bubble_->Hide();
+ NSRect frame = [window frame];
+ frame.origin.x += 50;
+ [window setFrame:frame display:YES];
+ bubble_->SetStatus(L"Reshowing");
+
+ // The bubble should reattach in the correct location.
+ child = GetWindow();
+ EXPECT_TRUE(NSEqualPoints([window frame].origin, [child frame].origin));
+}
« no previous file with comments | « chrome/browser/cocoa/status_bubble_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698