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

Side by Side Diff: mojo/edk/system/data_pipe_impl_unittest.cc

Issue 1530443005: EDK: Add PlatformHandleWatcher to Channel (and ChannelManager) classes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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/edk/system/channel_test_base.cc ('k') | mojo/edk/system/ipc_support.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 // 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 message_pipes_[i]->Close(0); 314 message_pipes_[i]->Close(0);
315 message_pipes_[i] = nullptr; 315 message_pipes_[i] = nullptr;
316 } 316 }
317 317
318 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0, 318 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0,
319 RefPtr<ChannelEndpoint>&& ep1) { 319 RefPtr<ChannelEndpoint>&& ep1) {
320 CHECK(io_thread_.IsCurrentAndRunning()); 320 CHECK(io_thread_.IsCurrentAndRunning());
321 321
322 embedder::PlatformChannelPair channel_pair; 322 embedder::PlatformChannelPair channel_pair;
323 channels_[0] = MakeRefCounted<Channel>(&platform_support_); 323 channels_[0] = MakeRefCounted<Channel>(&platform_support_);
324 channels_[0]->Init(RawChannel::Create(channel_pair.PassServerHandle())); 324 channels_[0]->Init(io_thread_.task_runner().Clone(),
325 io_thread_.platform_handle_watcher(),
326 RawChannel::Create(channel_pair.PassServerHandle()));
325 channels_[0]->SetBootstrapEndpoint(std::move(ep0)); 327 channels_[0]->SetBootstrapEndpoint(std::move(ep0));
326 channels_[1] = MakeRefCounted<Channel>(&platform_support_); 328 channels_[1] = MakeRefCounted<Channel>(&platform_support_);
327 channels_[1]->Init(RawChannel::Create(channel_pair.PassClientHandle())); 329 channels_[1]->Init(io_thread_.task_runner().Clone(),
330 io_thread_.platform_handle_watcher(),
331 RawChannel::Create(channel_pair.PassClientHandle()));
328 channels_[1]->SetBootstrapEndpoint(std::move(ep1)); 332 channels_[1]->SetBootstrapEndpoint(std::move(ep1));
329 } 333 }
330 334
331 void TearDownOnIOThread() { 335 void TearDownOnIOThread() {
332 CHECK(io_thread_.IsCurrentAndRunning()); 336 CHECK(io_thread_.IsCurrentAndRunning());
333 337
334 if (channels_[0]) { 338 if (channels_[0]) {
335 channels_[0]->Shutdown(); 339 channels_[0]->Shutdown();
336 channels_[0] = nullptr; 340 channels_[0] = nullptr;
337 } 341 }
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2489 test::Sleep(10u); 2493 test::Sleep(10u);
2490 2494
2491 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes)); 2495 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes));
2492 2496
2493 this->ConsumerClose(); 2497 this->ConsumerClose();
2494 } 2498 }
2495 2499
2496 } // namespace 2500 } // namespace
2497 } // namespace system 2501 } // namespace system
2498 } // namespace mojo 2502 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_test_base.cc ('k') | mojo/edk/system/ipc_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698