Index: chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm |
index a828a43a10eab606eaf8f389d305795aaaa3e379..0ffc1133a89367c4e0e4e355fea8d073d742a8ca 100644 |
--- a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm |
+++ b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm |
@@ -667,3 +667,19 @@ TEST_F(StatusBubbleMacTest, BubbleAvoidsMouse) { |
ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); |
} |
} |
+ |
+TEST_F(StatusBubbleMacTest, ReparentBubble) { |
+ // The second window is borderless, like the window used in fullscreen mode. |
+ base::scoped_nsobject<NSWindow> fullscreenParent( |
+ [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) |
+ styleMask:NSBorderlessWindowMask |
+ backing:NSBackingStoreBuffered |
+ defer:NO]); |
+ |
+ // Switch parents with the bubble hidden. |
+ bubble_->SwitchParentWindow(fullscreenParent); |
+ |
+ // Switch back to the original parent with the bubble showing. |
+ bubble_->SetStatus(UTF8ToUTF16("Showing")); |
+ bubble_->SwitchParentWindow(test_window()); |
+} |