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

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

Issue 1637383003: MacViews: Fix views_unittests BubbleDelegateTest.CloseReasons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-wrap comment. Created 4 years, 10 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 | 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 92201c0882a308cb08bee89482943f5a95868851..3039ae33b5990e4bb80a94b2f91f43167c7525ce 100644
--- a/ui/views/bubble/bubble_delegate_unittest.cc
+++ b/ui/views/bubble/bubble_delegate_unittest.cc
@@ -15,6 +15,10 @@
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
+#if defined(OS_MACOSX)
+#include "ui/base/test/scoped_fake_nswindow_focus.h"
+#endif
+
namespace views {
namespace {
@@ -66,6 +70,10 @@ class BubbleDelegateTest : public ViewsTestBase {
}
private:
+#if defined(OS_MACOSX)
+ ui::test::ScopedFakeNSWindowFocus fake_focus;
tapted 2016/03/03 23:34:50 oops - this should have an underscore on the end.
Patti Lor 2016/03/04 06:27:11 Done.
+#endif
+
DISALLOW_COPY_AND_ASSIGN(BubbleDelegateTest);
};
@@ -278,6 +286,19 @@ TEST_F(BubbleDelegateTest, CloseReasons) {
bubble_delegate->set_close_on_deactivate(true);
Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_delegate);
bubble_widget->Show();
+ EXPECT_FALSE(anchor_widget->IsVisible());
msw 2016/03/04 00:23:58 Why don't we just show |anchor_widget| earlier in
Patti Lor 2016/03/04 06:27:11 Done, will add another test fixture for the Aura b
+#if !defined(USE_AURA)
+ // Bubbles are top-level which, on Aura, causes the parent->child
+ // relationship to be managed by wm::TransientWindowManager rather than the
+ // ui::Layer hierarchy. TransientWindowManager currently permits a child to
+ // be shown when its parent is hidden, but it shouldn't.
+ // This is http://crbug.com/590957.
+ EXPECT_FALSE(bubble_widget->IsVisible());
+ anchor_widget->Show();
+ bubble_widget->Activate();
+#endif
+ EXPECT_TRUE(bubble_widget->IsVisible());
+ EXPECT_TRUE(bubble_widget->IsActive());
anchor_widget->Activate();
EXPECT_TRUE(bubble_widget->IsClosed());
EXPECT_EQ(BubbleDelegateView::CloseReason::DEACTIVATION,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698