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

Side by Side Diff: mojo/shell/tests/connect/connect_test_driver.cc

Issue 1801963002: Change primordial pipes to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase onto catalog CL Created 4 years, 9 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
« no previous file with comments | « mojo/shell/shell.cc ('k') | mojo/shell/tests/shell/driver.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/command_line.h" 6 #include "base/command_line.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/process/process.h" 8 #include "base/process/process.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "mojo/shell/public/cpp/connection.h" 10 #include "mojo/shell/public/cpp/connection.h"
(...skipping 19 matching lines...) Expand all
30 private: 30 private:
31 // mojo::ShellClient: 31 // mojo::ShellClient:
32 void Initialize(mojo::Connector* connector, const mojo::Identity& identity, 32 void Initialize(mojo::Connector* connector, const mojo::Identity& identity,
33 uint32_t id) override { 33 uint32_t id) override {
34 connector_ = connector; 34 connector_ = connector;
35 } 35 }
36 bool AcceptConnection(mojo::Connection* connection) override { 36 bool AcceptConnection(mojo::Connection* connection) override {
37 connection->AddInterface<ClientProcessTest>(this); 37 connection->AddInterface<ClientProcessTest>(this);
38 return true; 38 return true;
39 } 39 }
40 void ShellConnectionLost() override {
41 // TODO: This should exit cleanly.
42 _exit(1);
43 }
40 44
41 // mojo::InterfaceFactory<ConnectTestService>: 45 // mojo::InterfaceFactory<ConnectTestService>:
42 void Create(mojo::Connection* connection, 46 void Create(mojo::Connection* connection,
43 ClientProcessTestRequest request) override { 47 ClientProcessTestRequest request) override {
44 bindings_.AddBinding(this, std::move(request)); 48 bindings_.AddBinding(this, std::move(request));
45 } 49 }
46 50
47 // test::mojom::ClientProcessTest: 51 // test::mojom::ClientProcessTest:
48 void LaunchAndConnectToProcess( 52 void LaunchAndConnectToProcess(
49 const LaunchAndConnectToProcessCallback& callback) override { 53 const LaunchAndConnectToProcessCallback& callback) override {
(...skipping 24 matching lines...) Expand all
74 78
75 int main(int argc, char** argv) { 79 int main(int argc, char** argv) {
76 base::AtExitManager at_exit; 80 base::AtExitManager at_exit;
77 base::CommandLine::Init(argc, argv); 81 base::CommandLine::Init(argc, argv);
78 82
79 mojo::shell::InitializeLogging(); 83 mojo::shell::InitializeLogging();
80 84
81 Driver driver; 85 Driver driver;
82 return mojo::shell::TestNativeMain(&driver); 86 return mojo::shell::TestNativeMain(&driver);
83 } 87 }
OLDNEW
« no previous file with comments | « mojo/shell/shell.cc ('k') | mojo/shell/tests/shell/driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698