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

Unified Diff: ui/views/test/views_test_base.h

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_base.h
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h
index d3733b67fbbc495d9f38b3fb09dd39b743efa9db..ce2f2167d3cf479944515d84192509da085ff94c 100644
--- a/ui/views/test/views_test_base.h
+++ b/ui/views/test/views_test_base.h
@@ -34,6 +34,16 @@ class ViewsTestBase : public PlatformTest {
void RunPendingMessages();
+ // When using desktop widgets on Mac, window activation is asynchronous
+ // because the window server is involved. A window may also be deactivated by
+ // a test running in parallel, making it flaky. Calling this method permits a
+ // unit test to "fake" this activation, causing it to be synchronous and
+ // per-process instead. Note that window activation on X11 is also
+ // asynchronous, and on Windows another process may "steal" activation from a
+ // parallelized unit_test run. However, a test can use non-desktop widgets
+ // there instead.
+ void EnableMacFakeWindowActivation();
+
// Creates a widget of |type| with any platform specific data for use in
// cross-platform tests.
Widget::InitParams CreateParams(Widget::InitParams::Type type);

Powered by Google App Engine
This is Rietveld 408576698