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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/mus/views_mus_test_suite.h" 5 #include "ui/views/mus/views_mus_test_suite.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 void ViewsMusTestSuite::Initialize() { 246 void ViewsMusTestSuite::Initialize() {
247 PlatformTestHelper::SetIsMus(); 247 PlatformTestHelper::SetIsMus();
248 // Let other services know that we're running in tests. Do this with a 248 // Let other services know that we're running in tests. Do this with a
249 // command line flag to avoid making blocking calls to other processes for 249 // command line flag to avoid making blocking calls to other processes for
250 // setup for tests (e.g. to unlock the screen in the window manager). 250 // setup for tests (e.g. to unlock the screen in the window manager).
251 EnsureCommandLineSwitch(ui::switches::kUseTestConfig); 251 EnsureCommandLineSwitch(ui::switches::kUseTestConfig);
252 252
253 EnsureCommandLineSwitch(switches::kOverrideUseSoftwareGLForTests); 253 EnsureCommandLineSwitch(switches::kOverrideUseSoftwareGLForTests);
254 254
255 // aura::Env detects whether it is being run as a mus client by looking for
256 // this flag. By setting this flag, we prevent the creation of an
257 // OzonePlatformX11 in mus client processes, which was previously causing
258 // false negatives, as the tests would pass because they were running against
259 // X11 and not mus.
260 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
261 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
262
255 ViewsTestSuite::Initialize(); 263 ViewsTestSuite::Initialize();
256 service_manager_connections_ = base::MakeUnique<ServiceManagerConnection>(); 264 service_manager_connections_ = base::MakeUnique<ServiceManagerConnection>();
257 } 265 }
258 266
259 void ViewsMusTestSuite::Shutdown() { 267 void ViewsMusTestSuite::Shutdown() {
260 service_manager_connections_.reset(); 268 service_manager_connections_.reset();
261 ViewsTestSuite::Shutdown(); 269 ViewsTestSuite::Shutdown();
262 } 270 }
263 271
264 } // namespace views 272 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698