| Index: ui/views/test/views_test_helper_mac.mm
|
| diff --git a/ui/views/test/views_test_helper_mac.mm b/ui/views/test/views_test_helper_mac.mm
|
| index 8ef73d27487d7106d4acc9b2bac3b4c38eab21ea..529d5c666b8a6a660fae5a5937dfe5f92380465f 100644
|
| --- a/ui/views/test/views_test_helper_mac.mm
|
| +++ b/ui/views/test/views_test_helper_mac.mm
|
| @@ -7,6 +7,8 @@
|
| #import <Cocoa/Cocoa.h>
|
|
|
| #import "base/mac/scoped_nsautorelease_pool.h"
|
| +#include "ui/base/test/scoped_fake_nswindow_focus.h"
|
| +#include "ui/base/test/ui_controls.h"
|
| #include "ui/compositor/scoped_animation_duration_scale_mode.h"
|
| #include "ui/views/test/event_generator_delegate_mac.h"
|
| #include "ui/views/widget/widget.h"
|
| @@ -33,6 +35,16 @@ ViewsTestHelperMac::ViewsTestHelperMac()
|
| ViewsTestHelperMac::~ViewsTestHelperMac() {
|
| }
|
|
|
| +void ViewsTestHelperMac::SetUp() {
|
| + ViewsTestHelper::SetUp();
|
| + // Assume that if the methods in the ui_controls.h test header are enabled
|
| + // then the test runner is in a non-sharded mode, and will use "real"
|
| + // activations. This allows interactive_ui_tests to test the actual OS window
|
| + // activation codepaths.
|
| + if (!ui_controls::IsUIControlsEnabled())
|
| + faked_focus_.reset(new ui::test::ScopedFakeNSWindowFocus);
|
| +}
|
| +
|
| void ViewsTestHelperMac::TearDown() {
|
| // Ensure all Widgets are closed explicitly in tests. The Widget may be
|
| // hosting a Compositor. If that's torn down after the test ContextFactory
|
|
|