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

Unified Diff: ui/views/widget/widget_unittest.cc

Issue 133073010: [Views] Cause the window controls to be reset independent of title update in the non-client view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test Created 6 years, 11 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 | « ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index c9cdd87539a39ad8d90af3ee8e35710b1d455a08..743e2e10451847153a7fe95a69580aeff226b917 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -944,6 +944,36 @@ TEST_F(WidgetTest, DISABLED_FocusChangesOnBubble) {
EXPECT_TRUE(contents_view->HasFocus());
}
+class TestBubbleDelegateView : public BubbleDelegateView {
+ public:
+ TestBubbleDelegateView(View* anchor)
+ : BubbleDelegateView(anchor, BubbleBorder::NONE),
+ reset_controls_called_(false) {}
+ virtual ~TestBubbleDelegateView() {}
+
+ virtual bool ShouldShowCloseButton() const OVERRIDE {
+ reset_controls_called_ = true;
+ return true;
+ }
+
+ mutable bool reset_controls_called_;
+};
+
+TEST_F(WidgetTest, BubbleControlsResetOnInit) {
+ Widget* anchor = CreateTopLevelPlatformWidget();
+ anchor->Show();
+
+ TestBubbleDelegateView* bubble_delegate =
+ new TestBubbleDelegateView(anchor->client_view());
+ Widget* bubble_widget(BubbleDelegateView::CreateBubble(bubble_delegate));
+ EXPECT_TRUE(bubble_delegate->reset_controls_called_);
+ bubble_widget->Show();
+ bubble_widget->CloseNow();
+
+ anchor->Hide();
+ anchor->CloseNow();
+}
+
// Desktop native widget Aura tests are for non Chrome OS platforms.
#if !defined(OS_CHROMEOS)
// Test to ensure that after minimize, view width is set to zero.
« no previous file with comments | « ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698