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

Side by Side Diff: mojo/edk/embedder/embedder_unittest.cc

Issue 2738853002: Connections now take a ConnectionParams instead of a pipe handle. (Closed)
Patch Set: Fix Win release build. Created 3 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/edk/embedder/embedder.cc ('k') | mojo/edk/embedder/pending_process_connection.h » ('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 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 "mojo/edk/embedder/embedder.h" 5 #include "mojo/edk/embedder/embedder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 EXPECT_EQ(kHello, ReadMessage(child_mp.get().value())); 204 EXPECT_EQ(kHello, ReadMessage(child_mp.get().value()));
205 } 205 }
206 206
207 TEST_F(EmbedderTest, PipeSetup_LaunchDeath) { 207 TEST_F(EmbedderTest, PipeSetup_LaunchDeath) {
208 PlatformChannelPair pair; 208 PlatformChannelPair pair;
209 209
210 PendingProcessConnection process; 210 PendingProcessConnection process;
211 std::string pipe_token; 211 std::string pipe_token;
212 ScopedMessagePipeHandle parent_mp = process.CreateMessagePipe(&pipe_token); 212 ScopedMessagePipeHandle parent_mp = process.CreateMessagePipe(&pipe_token);
213 process.Connect(base::GetCurrentProcessHandle(), pair.PassServerHandle()); 213 process.Connect(base::GetCurrentProcessHandle(),
214 ConnectionParams(pair.PassServerHandle()));
214 215
215 // Close the remote end, simulating child death before the child connects to 216 // Close the remote end, simulating child death before the child connects to
216 // the reserved port. 217 // the reserved port.
217 ignore_result(pair.PassClientHandle()); 218 ignore_result(pair.PassClientHandle());
218 219
219 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), 220 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(),
220 MOJO_HANDLE_SIGNAL_PEER_CLOSED, 221 MOJO_HANDLE_SIGNAL_PEER_CLOSED,
221 MOJO_DEADLINE_INDEFINITE, 222 MOJO_DEADLINE_INDEFINITE,
222 nullptr)); 223 nullptr));
223 } 224 }
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 client_mp) { 653 client_mp) {
653 ASSERT_EQ(MOJO_RESULT_OK, MojoWait(client_mp, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 654 ASSERT_EQ(MOJO_RESULT_OK, MojoWait(client_mp, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
654 MOJO_DEADLINE_INDEFINITE, nullptr)); 655 MOJO_DEADLINE_INDEFINITE, nullptr));
655 } 656 }
656 657
657 #endif // !defined(OS_IOS) 658 #endif // !defined(OS_IOS)
658 659
659 } // namespace 660 } // namespace
660 } // namespace edk 661 } // namespace edk
661 } // namespace mojo 662 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/embedder.cc ('k') | mojo/edk/embedder/pending_process_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698