| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ipc/mojo/ipc_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 base::MessageLoopForIO main_message_loop_; | 76 base::MessageLoopForIO main_message_loop_; |
| 77 scoped_ptr<IPC::ChannelMojo> channel_; | 77 scoped_ptr<IPC::ChannelMojo> channel_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 class IPCChannelMojoTest : public IPCTestBase { | 80 class IPCChannelMojoTest : public IPCTestBase { |
| 81 protected: | 81 protected: |
| 82 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( | 82 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( |
| 83 const IPC::ChannelHandle& handle, | 83 const IPC::ChannelHandle& handle, |
| 84 base::TaskRunner* runner) OVERRIDE { | 84 base::TaskRunner* runner) OVERRIDE { |
| 85 host_.reset(new IPC::ChannelMojoHost(task_runner())); | 85 host_.reset(new IPC::ChannelMojoHost(task_runner())); |
| 86 return IPC::ChannelMojo::CreateServerFactory(host_.get(), handle); | 86 return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(), |
| 87 handle); |
| 87 } | 88 } |
| 88 | 89 |
| 89 virtual bool DidStartClient() OVERRIDE { | 90 virtual bool DidStartClient() OVERRIDE { |
| 90 bool ok = IPCTestBase::DidStartClient(); | 91 bool ok = IPCTestBase::DidStartClient(); |
| 91 DCHECK(ok); | 92 DCHECK(ok); |
| 92 host_->OnClientLaunched(client_process()); | 93 host_->OnClientLaunched(client_process()); |
| 93 return ok; | 94 return ok; |
| 94 } | 95 } |
| 95 | 96 |
| 96 private: | 97 private: |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool has_error_; | 184 bool has_error_; |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 | 187 |
| 187 class IPCChannelMojoErrorTest : public IPCTestBase { | 188 class IPCChannelMojoErrorTest : public IPCTestBase { |
| 188 protected: | 189 protected: |
| 189 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( | 190 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( |
| 190 const IPC::ChannelHandle& handle, | 191 const IPC::ChannelHandle& handle, |
| 191 base::TaskRunner* runner) OVERRIDE { | 192 base::TaskRunner* runner) OVERRIDE { |
| 192 host_.reset(new IPC::ChannelMojoHost(task_runner())); | 193 host_.reset(new IPC::ChannelMojoHost(task_runner())); |
| 193 return IPC::ChannelMojo::CreateServerFactory(host_.get(), handle); | 194 return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(), |
| 195 handle); |
| 194 } | 196 } |
| 195 | 197 |
| 196 virtual bool DidStartClient() OVERRIDE { | 198 virtual bool DidStartClient() OVERRIDE { |
| 197 bool ok = IPCTestBase::DidStartClient(); | 199 bool ok = IPCTestBase::DidStartClient(); |
| 198 DCHECK(ok); | 200 DCHECK(ok); |
| 199 host_->OnClientLaunched(client_process()); | 201 host_->OnClientLaunched(client_process()); |
| 200 return ok; | 202 return ok; |
| 201 } | 203 } |
| 202 | 204 |
| 203 private: | 205 private: |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 client.Connect(); | 341 client.Connect(); |
| 340 listener.set_sender(client.channel()); | 342 listener.set_sender(client.channel()); |
| 341 | 343 |
| 342 base::MessageLoop::current()->Run(); | 344 base::MessageLoop::current()->Run(); |
| 343 | 345 |
| 344 return 0; | 346 return 0; |
| 345 } | 347 } |
| 346 #endif | 348 #endif |
| 347 | 349 |
| 348 } // namespace | 350 } // namespace |
| OLD | NEW |