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

Unified Diff: ui/views/bubble/bubble_delegate_unittest.cc

Issue 89503003: Close bubble widget when its anchor widget bounds has changed and move_with_anchor is false. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: close bubble widget Created 7 years, 1 month 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 | « ui/views/bubble/bubble_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_delegate_unittest.cc
diff --git a/ui/views/bubble/bubble_delegate_unittest.cc b/ui/views/bubble/bubble_delegate_unittest.cc
index 4c720885f0942f8791b4fd0eb3c776b66cd0dbf9..91049007f080e1661db0d3d6d80bbc9a3ad6699c 100644
--- a/ui/views/bubble/bubble_delegate_unittest.cc
+++ b/ui/views/bubble/bubble_delegate_unittest.cc
@@ -244,6 +244,20 @@ TEST_F(BubbleDelegateTest, NonClientHitTest) {
}
}
+TEST_F(BubbleDelegateTest, CloseWhenAnchorWidgetBoundsChanged) {
+ scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ BubbleDelegateView* bubble_delegate = new BubbleDelegateView(
+ anchor_widget->GetContentsView(), BubbleBorder::NONE);
+ Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_delegate);
+ test::TestWidgetObserver bubble_observer(bubble_widget);
msw 2013/11/27 01:05:00 nit: you can remove bubble_observer since you test
+ EXPECT_FALSE(bubble_observer.widget_closed());
msw 2013/11/27 01:05:00 nit: you can remove this.
+
+ bubble_widget->Show();
+ EXPECT_TRUE(bubble_widget->IsVisible());
+ anchor_widget->SetBounds(gfx::Rect(10, 10, 100, 100));
msw 2013/11/27 01:05:00 nit: consider making the bubble move_with_anchor f
+ EXPECT_FALSE(bubble_widget->IsVisible());
+}
+
// This class provides functionality to verify that the BubbleView shows up
// when we call BubbleDelegateView::StartFade(true) and is destroyed when we
// call BubbleDelegateView::StartFade(false).
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698