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

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: Remove separate behaviour for Aura vs non-Aura. 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..5998d1487b8c405e35cbf22a8edc9293e8e2085e 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,11 @@ class BubbleDelegateTest : public ViewsTestBase {
}
private:
+#if defined(OS_MACOSX)
+ // Ensure tests running in parallel don't steal focus from the Widget on Mac.
+ ui::test::ScopedFakeNSWindowFocus fake_focus_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(BubbleDelegateTest);
};
@@ -277,6 +286,7 @@ TEST_F(BubbleDelegateTest, CloseReasons) {
anchor_widget->GetContentsView(), BubbleBorder::NONE);
bubble_delegate->set_close_on_deactivate(true);
Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_delegate);
+ anchor_widget->Show();
bubble_widget->Show();
anchor_widget->Activate();
EXPECT_TRUE(bubble_widget->IsClosed());
« 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