OLD | NEW |
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 // This file contains tests that are shared between different implementations of | 5 // This file contains tests that are shared between different implementations of |
6 // |DataPipeImpl|. | 6 // |DataPipeImpl|. |
7 | 7 |
8 #include "mojo/edk/system/data_pipe_impl.h" | 8 #include "mojo/edk/system/data_pipe_impl.h" |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 317 } |
318 | 318 |
319 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0, | 319 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0, |
320 RefPtr<ChannelEndpoint>&& ep1) { | 320 RefPtr<ChannelEndpoint>&& ep1) { |
321 CHECK(io_thread_.IsCurrentAndRunning()); | 321 CHECK(io_thread_.IsCurrentAndRunning()); |
322 | 322 |
323 embedder::PlatformChannelPair channel_pair; | 323 embedder::PlatformChannelPair channel_pair; |
324 channels_[0] = MakeRefCounted<Channel>(&platform_support_); | 324 channels_[0] = MakeRefCounted<Channel>(&platform_support_); |
325 channels_[0]->Init(io_thread_.task_runner().Clone(), | 325 channels_[0]->Init(io_thread_.task_runner().Clone(), |
326 io_thread_.platform_handle_watcher(), | 326 io_thread_.platform_handle_watcher(), |
327 RawChannel::Create(channel_pair.PassServerHandle())); | 327 RawChannel::Create(channel_pair.handle0.Pass())); |
328 channels_[0]->SetBootstrapEndpoint(std::move(ep0)); | 328 channels_[0]->SetBootstrapEndpoint(std::move(ep0)); |
329 channels_[1] = MakeRefCounted<Channel>(&platform_support_); | 329 channels_[1] = MakeRefCounted<Channel>(&platform_support_); |
330 channels_[1]->Init(io_thread_.task_runner().Clone(), | 330 channels_[1]->Init(io_thread_.task_runner().Clone(), |
331 io_thread_.platform_handle_watcher(), | 331 io_thread_.platform_handle_watcher(), |
332 RawChannel::Create(channel_pair.PassClientHandle())); | 332 RawChannel::Create(channel_pair.handle1.Pass())); |
333 channels_[1]->SetBootstrapEndpoint(std::move(ep1)); | 333 channels_[1]->SetBootstrapEndpoint(std::move(ep1)); |
334 } | 334 } |
335 | 335 |
336 void TearDownOnIOThread() { | 336 void TearDownOnIOThread() { |
337 CHECK(io_thread_.IsCurrentAndRunning()); | 337 CHECK(io_thread_.IsCurrentAndRunning()); |
338 | 338 |
339 if (channels_[0]) { | 339 if (channels_[0]) { |
340 channels_[0]->Shutdown(); | 340 channels_[0]->Shutdown(); |
341 channels_[0] = nullptr; | 341 channels_[0] = nullptr; |
342 } | 342 } |
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 ThreadSleep(10u); | 2494 ThreadSleep(10u); |
2495 | 2495 |
2496 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes)); | 2496 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes)); |
2497 | 2497 |
2498 this->ConsumerClose(); | 2498 this->ConsumerClose(); |
2499 } | 2499 } |
2500 | 2500 |
2501 } // namespace | 2501 } // namespace |
2502 } // namespace system | 2502 } // namespace system |
2503 } // namespace mojo | 2503 } // namespace mojo |
OLD | NEW |