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

Side by Side Diff: mojo/shell/application_manager_apptest_driver.cc

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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
« no previous file with comments | « mojo/shell/application_manager_apptest.cc ('k') | mojo/shell/application_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/base_paths.h" 6 #include "base/base_paths.h"
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 25 matching lines...) Expand all
36 public Driver { 36 public Driver {
37 public: 37 public:
38 TargetApplicationDelegate() : app_(nullptr), weak_factory_(this) {} 38 TargetApplicationDelegate() : app_(nullptr), weak_factory_(this) {}
39 ~TargetApplicationDelegate() override {} 39 ~TargetApplicationDelegate() override {}
40 40
41 private: 41 private:
42 // mojo::ApplicationDelegate: 42 // mojo::ApplicationDelegate:
43 void Initialize(mojo::ApplicationImpl* app) override { 43 void Initialize(mojo::ApplicationImpl* app) override {
44 app_ = app; 44 app_ = app;
45 mojo::shell::mojom::ApplicationManagerPtr application_manager; 45 mojo::shell::mojom::ApplicationManagerPtr application_manager;
46 app_->ConnectToService(mojo::URLRequest::From(std::string("mojo:shell")), 46 app_->ConnectToService("mojo:shell", &application_manager);
47 &application_manager);
48 47
49 base::FilePath target_path; 48 base::FilePath target_path;
50 CHECK(base::PathService::Get(base::DIR_EXE, &target_path)); 49 CHECK(base::PathService::Get(base::DIR_EXE, &target_path));
51 #if defined(OS_WIN) 50 #if defined(OS_WIN)
52 target_path = target_path.Append( 51 target_path = target_path.Append(
53 FILE_PATH_LITERAL("application_manager_apptest_target.exe")); 52 FILE_PATH_LITERAL("application_manager_apptest_target.exe"));
54 #else 53 #else
55 target_path = target_path.Append( 54 target_path = target_path.Append(
56 FILE_PATH_LITERAL("application_manager_apptest_target")); 55 FILE_PATH_LITERAL("application_manager_apptest_target"));
57 #endif 56 #endif
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 127
129 int main(int argc, char** argv) { 128 int main(int argc, char** argv) {
130 base::AtExitManager at_exit; 129 base::AtExitManager at_exit;
131 base::CommandLine::Init(argc, argv); 130 base::CommandLine::Init(argc, argv);
132 131
133 mojo::runner::InitializeLogging(); 132 mojo::runner::InitializeLogging();
134 133
135 TargetApplicationDelegate delegate; 134 TargetApplicationDelegate delegate;
136 return mojo::runner::TestNativeMain(&delegate); 135 return mojo::runner::TestNativeMain(&delegate);
137 } 136 }
OLDNEW
« no previous file with comments | « mojo/shell/application_manager_apptest.cc ('k') | mojo/shell/application_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698