Commit 4795dc0e authored by msw's avatar msw Committed by Commit bot

Fix native_viewport CommandLine; enable window_manager_apptests.

Update the native_viewport CommandLine usage pattern.
(codereview.chromium.org/1057603003 removed per-app args)

Re-enable window_manager_apptests with test and headless flags.
(our FYI waterfall: http://build.chromium.org/p/chromium.mojo/console)

BUG=480040
TEST=Tests pass on the waterfall.
R=sky@chromium.org
TBR=jochen@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#327139}
parent a0ad227f
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include <algorithm>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
...@@ -38,27 +36,13 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate, ...@@ -38,27 +36,13 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
void Initialize(mojo::ApplicationImpl* application) override { void Initialize(mojo::ApplicationImpl* application) override {
tracing_.Initialize(application); tracing_.Initialize(application);
#if defined(OS_LINUX)
// Apply the switch for kTouchEvents to CommandLine (if set). This allows
// redirecting the mouse to a touch device on X for testing.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
const std::string touch_event_string("--" + if (command_line->HasSwitch(mojo::kUseTestConfig))
std::string(switches::kTouchDevices));
auto touch_iter = std::find(application->args().begin(),
application->args().end(),
touch_event_string);
if (touch_iter != application->args().end() &&
++touch_iter != application->args().end()) {
command_line->AppendSwitchASCII(touch_event_string, *touch_iter);
}
#endif
if (application->HasArg(mojo::kUseTestConfig))
gfx::GLSurface::InitializeOneOffForTests(); gfx::GLSurface::InitializeOneOffForTests();
else else
gfx::GLSurface::InitializeOneOff(); gfx::GLSurface::InitializeOneOff();
is_headless_ = application->HasArg(mojo::kUseHeadlessConfig); is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig);
} }
bool ConfigureIncomingConnection(ApplicationConnection* connection) override { bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
namespace mojo { namespace mojo {
// Instead of using the system GL implementation, use OSMesa. // Instead of using the system GL implementation, use OSMesa.
const char kUseOSMesa[] = "--use-osmesa"; const char kUseOSMesa[] = "use-osmesa";
// Loads an app from the specified directory and launches it. // Loads an app from the specified directory and launches it.
// Force gl to be initialized in test mode. // Force gl to be initialized in test mode.
const char kUseTestConfig[] = "--use-test-config"; 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";
} // namespace mojo } // namespace mojo
...@@ -44,8 +44,8 @@ tests = [ ...@@ -44,8 +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-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