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

Side by Side Diff: components/web_view/test_runner/launcher.cc

Issue 1630823002: Move mojo/runner to mojo/shell/standalone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/web_view/test_runner/launcher.h" 5 #include "components/web_view/test_runner/launcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "mojo/runner/context.h" 10 #include "mojo/shell/standalone/context.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 namespace web_view { 13 namespace web_view {
14 14
15 int LaunchTestRunner(int argc, char** argv) { 15 int LaunchTestRunner(int argc, char** argv) {
16 // We want the runner::Context to outlive the MessageLoop so that pipes are 16 // We want the runner::Context to outlive the MessageLoop so that pipes are
17 // all gracefully closed / error-out before we try to shut the Context down. 17 // all gracefully closed / error-out before we try to shut the Context down.
18 mojo::runner::Context shell_context; 18 mojo::shell::Context shell_context;
19 { 19 {
20 base::MessageLoop message_loop; 20 base::MessageLoop message_loop;
21 base::FilePath shell_dir; 21 base::FilePath shell_dir;
22 PathService::Get(base::DIR_MODULE, &shell_dir); 22 PathService::Get(base::DIR_MODULE, &shell_dir);
23 if (!shell_context.Init(shell_dir)) { 23 if (!shell_context.Init(shell_dir)) {
24 return 0; 24 return 0;
25 } 25 }
26 26
27 message_loop.PostTask(FROM_HERE, 27 message_loop.PostTask(FROM_HERE,
28 base::Bind(&mojo::runner::Context::Run, 28 base::Bind(&mojo::shell::Context::Run,
29 base::Unretained(&shell_context), 29 base::Unretained(&shell_context),
30 GURL("mojo:web_view_test_runner"))); 30 GURL("mojo:web_view_test_runner")));
31 message_loop.Run(); 31 message_loop.Run();
32 32
33 // Must be called before |message_loop| is destroyed. 33 // Must be called before |message_loop| is destroyed.
34 shell_context.Shutdown(); 34 shell_context.Shutdown();
35 } 35 }
36 36
37 return 0; 37 return 0;
38 } 38 }
39 39
40 } // namespace web_view 40 } // namespace web_view
OLDNEW
« no previous file with comments | « components/web_view/test_runner/DEPS ('k') | components/web_view/test_runner/register_local_aliases.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698