Commit 84ba30ab authored by msw's avatar msw Committed by Commit bot

Skip gl surface init when headless; enable wm apptests.

Skip native_viewport's init of gfx::GLSurface when headless.
Remove the unused --use-osmesa flag (--use-test-config suffices?).
Re-enable the window_manager_apptests again; fingers crossed.

BUG=480040
TEST=Bot passes window_manager_apptests.
R=sky@chromium.org
TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/1103413002

Cr-Commit-Position: refs/heads/master@{#327184}
parent 2433e6ab
...@@ -37,12 +37,13 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate, ...@@ -37,12 +37,13 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
tracing_.Initialize(application); tracing_.Initialize(application);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(mojo::kUseTestConfig))
gfx::GLSurface::InitializeOneOffForTests();
else
gfx::GLSurface::InitializeOneOff();
is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig); is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig);
if (!is_headless_) {
if (command_line->HasSwitch(mojo::kUseTestConfig))
gfx::GLSurface::InitializeOneOffForTests();
else
gfx::GLSurface::InitializeOneOff();
}
} }
bool ConfigureIncomingConnection(ApplicationConnection* connection) override { bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
......
...@@ -10,7 +10,6 @@ namespace mojo { ...@@ -10,7 +10,6 @@ namespace mojo {
// All args in alphabetical order. The switches should be documented // All args in alphabetical order. The switches should be documented
// alongside the definition of their values in the .cc file. // alongside the definition of their values in the .cc file.
extern const char kUseHeadlessConfig[]; extern const char kUseHeadlessConfig[];
extern const char kUseOSMesa[];
extern const char kUseTestConfig[]; extern const char kUseTestConfig[];
} // namespace mojo } // namespace mojo
......
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
namespace mojo { namespace mojo {
// Instead of using the system GL implementation, use OSMesa.
const char kUseOSMesa[] = "use-osmesa";
// Loads an app from the specified directory and launches it.
// Force gl to be initialized in test mode.
const char kUseTestConfig[] = "use-test-config";
// Create native viewport in headless mode. // Create native viewport in headless mode.
const char kUseHeadlessConfig[] = "use-headless-config"; const char kUseHeadlessConfig[] = "use-headless-config";
// Force gl to be initialized in test mode.
const char kUseTestConfig[] = "use-test-config";
} // namespace mojo } // namespace mojo
...@@ -44,9 +44,8 @@ tests = [ ...@@ -44,9 +44,8 @@ tests = [
"type": "gtest_isolated", "type": "gtest_isolated",
"shell-args": ["--url-mappings=mojo:window_manager=mojo:test_window_manager"] "shell-args": ["--url-mappings=mojo:window_manager=mojo:test_window_manager"]
}, },
# TODO(msw): Fix and enable window_manager_apptests: http://crbug.com/480040 {
#{ "test": "mojo:window_manager_apptests",
# "test": "mojo:window_manager_apptests", "shell-args": ["--use-headless-config"]
# "shell-args": ["--use-test-config", "--use-headless-config"] },
#},
] ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment