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

Unified Diff: ui/views/mus/views_mus_test_suite.cc

Issue 2807833002: [views-mus] Prevent creating a native OzonePlatform in mus tests. (Closed)
Patch Set: Use the same detection method at all levels. Created 3 years, 8 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/mus/views_mus_test_suite.cc
diff --git a/ui/views/mus/views_mus_test_suite.cc b/ui/views/mus/views_mus_test_suite.cc
index 86b748839e150b88e1a10d9660706f8e3478087a..829d0d460c6a6684c2f48c7821b1264751e26f3f 100644
--- a/ui/views/mus/views_mus_test_suite.cc
+++ b/ui/views/mus/views_mus_test_suite.cc
@@ -252,6 +252,14 @@ void ViewsMusTestSuite::Initialize() {
EnsureCommandLineSwitch(switches::kOverrideUseSoftwareGLForTests);
+ // aura::Env detects whether it is being run as a mus client by looking for
+ // this flag. By setting this flag, we prevent the creation of an
+ // OzonePlatformX11 in mus client processes, which was previously causing
+ // false negatives, as the tests would pass because they were running against
+ // X11 and not mus.
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ command_line->AppendSwitch("primordial-pipe-token");
sky 2017/04/10 23:53:26 This is mildly confusing and could easily confuse
Elliot Glaysher 2017/04/12 18:09:16 I've changed how mus works so that it no longer de
+
ViewsTestSuite::Initialize();
service_manager_connections_ = base::MakeUnique<ServiceManagerConnection>();
}

Powered by Google App Engine
This is Rietveld 408576698