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

Unified Diff: components/web_view/test_runner/launcher.cc

Issue 1308973005: html_viewer/web_view: An app for running layout-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot/merge Created 5 years, 3 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
« no previous file with comments | « components/web_view/test_runner/launcher.h ('k') | components/web_view/test_runner/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_view/test_runner/launcher.cc
diff --git a/components/web_view/test_runner/launcher.cc b/components/web_view/test_runner/launcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..58ce54b1a371d81e79ff2ec501bc05e7d31d81b2
--- /dev/null
+++ b/components/web_view/test_runner/launcher.cc
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/web_view/test_runner/launcher.h"
+
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "mojo/runner/context.h"
+#include "url/gurl.h"
+
+namespace web_view {
+
+int LaunchTestRunner(int argc, char** argv) {
+ // We want the runner::Context to outlive the MessageLoop so that pipes are
+ // all gracefully closed / error-out before we try to shut the Context down.
+ mojo::runner::Context shell_context;
+ {
+ base::MessageLoop message_loop;
+ if (!shell_context.Init()) {
+ return 0;
+ }
+
+ message_loop.PostTask(FROM_HERE,
+ base::Bind(&mojo::runner::Context::Run,
+ base::Unretained(&shell_context),
+ GURL("mojo:web_view_test_runner")));
+ message_loop.Run();
+
+ // Must be called before |message_loop| is destroyed.
+ shell_context.Shutdown();
+ }
+
+ return 0;
+}
+
+} // namespace web_view
« no previous file with comments | « components/web_view/test_runner/launcher.h ('k') | components/web_view/test_runner/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698