OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 scoped_refptr<ChannelEndpoint> ep; | 309 scoped_refptr<ChannelEndpoint> ep; |
310 scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy(&ep)); | 310 scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy(&ep)); |
311 Init(ep); | 311 Init(ep); |
312 | 312 |
313 // Make a shared buffer. | 313 // Make a shared buffer. |
314 scoped_refptr<SharedBufferDispatcher> dispatcher; | 314 scoped_refptr<SharedBufferDispatcher> dispatcher; |
315 EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create( | 315 EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create( |
316 platform_support(), | 316 platform_support(), |
317 SharedBufferDispatcher::kDefaultCreateOptions, | 317 SharedBufferDispatcher::kDefaultCreateOptions, |
318 100, &dispatcher)); | 318 100, &dispatcher)); |
319 ASSERT_TRUE(dispatcher.get()); | 319 ASSERT_TRUE(dispatcher); |
320 | 320 |
321 // Make a mapping. | 321 // Make a mapping. |
322 scoped_ptr<embedder::PlatformSharedBufferMapping> mapping; | 322 scoped_ptr<embedder::PlatformSharedBufferMapping> mapping; |
323 EXPECT_EQ(MOJO_RESULT_OK, | 323 EXPECT_EQ(MOJO_RESULT_OK, |
324 dispatcher->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 324 dispatcher->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); |
325 ASSERT_TRUE(mapping); | 325 ASSERT_TRUE(mapping); |
326 ASSERT_TRUE(mapping->GetBase()); | 326 ASSERT_TRUE(mapping->GetBase()); |
327 ASSERT_EQ(100u, mapping->GetLength()); | 327 ASSERT_EQ(100u, mapping->GetLength()); |
328 | 328 |
329 // Send the shared buffer. | 329 // Send the shared buffer. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); | 492 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); |
493 | 493 |
494 mp->Close(0); | 494 mp->Close(0); |
495 | 495 |
496 EXPECT_EQ(0, helper()->WaitForChildShutdown()); | 496 EXPECT_EQ(0, helper()->WaitForChildShutdown()); |
497 } | 497 } |
498 | 498 |
499 } // namespace | 499 } // namespace |
500 } // namespace system | 500 } // namespace system |
501 } // namespace mojo | 501 } // namespace mojo |
OLD | NEW |