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

Unified Diff: ui/views/test/views_test_helper_mac.mm

Issue 1782773002: MacViews: Fix ViewTest.HandleAccelerator by faking window activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delay the activatableness Created 4 years, 9 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
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..7a7df511dfd5c2949ddc5ca282b56a2b0342db8d 100644
--- a/ui/views/test/views_test_helper_mac.mm
+++ b/ui/views/test/views_test_helper_mac.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#import "base/mac/scoped_nsautorelease_pool.h"
+#include "ui/base/test/scoped_fake_nswindow_focus.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"
@@ -46,4 +47,8 @@ void ViewsTestHelperMac::TearDown() {
DCHECK(!Widget::GetWidgetForNativeWindow(window)) << "Widget not closed.";
}
+void ViewsTestHelperMac::EnableFakeWindowActivation() {
+ faked_focus_.reset(new ui::test::ScopedFakeNSWindowFocus);
sky 2016/03/10 18:59:16 Is there a reason not to do this always? By that I
tapted 2016/03/11 09:56:19 Done (see what you think). This has actually cros
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698