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

Side by Side Diff: mojo/edk/system/remote_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
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 tests both |RemoteProducerDataPipeImpl| and 5 // This file tests both |RemoteProducerDataPipeImpl| and
6 // |RemoteConsumerDataPipeImpl|. 6 // |RemoteConsumerDataPipeImpl|.
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 message_pipes_[i] = nullptr; 82 message_pipes_[i] = nullptr;
83 } 83 }
84 84
85 private: 85 private:
86 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0, 86 void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0,
87 RefPtr<ChannelEndpoint>&& ep1) { 87 RefPtr<ChannelEndpoint>&& ep1) {
88 CHECK(io_thread_.IsCurrentAndRunning()); 88 CHECK(io_thread_.IsCurrentAndRunning());
89 89
90 embedder::PlatformChannelPair channel_pair; 90 embedder::PlatformChannelPair channel_pair;
91 channels_[0] = MakeRefCounted<Channel>(&platform_support_); 91 channels_[0] = MakeRefCounted<Channel>(&platform_support_);
92 channels_[0]->Init(RawChannel::Create(channel_pair.PassServerHandle())); 92 channels_[0]->Init(io_thread_.task_runner().Clone(),
93 io_thread_.platform_handle_watcher(),
94 RawChannel::Create(channel_pair.PassServerHandle()));
93 channels_[0]->SetBootstrapEndpoint(std::move(ep0)); 95 channels_[0]->SetBootstrapEndpoint(std::move(ep0));
94 channels_[1] = MakeRefCounted<Channel>(&platform_support_); 96 channels_[1] = MakeRefCounted<Channel>(&platform_support_);
95 channels_[1]->Init(RawChannel::Create(channel_pair.PassClientHandle())); 97 channels_[1]->Init(io_thread_.task_runner().Clone(),
98 io_thread_.platform_handle_watcher(),
99 RawChannel::Create(channel_pair.PassClientHandle()));
96 channels_[1]->SetBootstrapEndpoint(std::move(ep1)); 100 channels_[1]->SetBootstrapEndpoint(std::move(ep1));
97 } 101 }
98 102
99 void TearDownOnIOThread() { 103 void TearDownOnIOThread() {
100 CHECK(io_thread_.IsCurrentAndRunning()); 104 CHECK(io_thread_.IsCurrentAndRunning());
101 105
102 if (channels_[0]) { 106 if (channels_[0]) {
103 channels_[0]->Shutdown(); 107 channels_[0]->Shutdown();
104 channels_[0] = nullptr; 108 channels_[0] = nullptr;
105 } 109 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 EXPECT_EQ(123456, elements[0]); 500 EXPECT_EQ(123456, elements[0]);
497 EXPECT_EQ(789012, elements[1]); 501 EXPECT_EQ(789012, elements[1]);
498 EXPECT_EQ(0, elements[2]); 502 EXPECT_EQ(0, elements[2]);
499 503
500 consumer->Close(); 504 consumer->Close();
501 } 505 }
502 506
503 } // namespace 507 } // namespace
504 } // namespace system 508 } // namespace system
505 } // namespace mojo 509 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_test_utils.cc ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698