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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) { | 371 TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) { |
372 helper()->StartChild("CheckSharedBuffer"); | 372 helper()->StartChild("CheckSharedBuffer"); |
373 | 373 |
374 scoped_refptr<MessagePipe> mp(new MessagePipe( | 374 scoped_refptr<MessagePipe> mp(new MessagePipe( |
375 scoped_ptr<MessagePipeEndpoint>(new LocalMessagePipeEndpoint()), | 375 scoped_ptr<MessagePipeEndpoint>(new LocalMessagePipeEndpoint()), |
376 scoped_ptr<MessagePipeEndpoint>(new ProxyMessagePipeEndpoint()))); | 376 scoped_ptr<MessagePipeEndpoint>(new ProxyMessagePipeEndpoint()))); |
377 Init(mp); | 377 Init(mp); |
378 | 378 |
379 // Make a shared buffer. | 379 // Make a shared buffer. |
380 scoped_refptr<SharedBufferDispatcher> dispatcher; | 380 scoped_refptr<SharedBufferDispatcher> dispatcher; |
381 MojoCreateSharedBufferOptions validated_options = {}; | |
382 EXPECT_EQ(MOJO_RESULT_OK, | 381 EXPECT_EQ(MOJO_RESULT_OK, |
383 SharedBufferDispatcher::ValidateCreateOptions(NULL, | 382 SharedBufferDispatcher::Create( |
384 &validated_options)); | 383 SharedBufferDispatcher::kDefaultCreateOptions, 100, |
385 EXPECT_EQ(MOJO_RESULT_OK, | 384 &dispatcher)); |
386 SharedBufferDispatcher::Create(validated_options, 100, | |
387 &dispatcher)); | |
388 ASSERT_TRUE(dispatcher); | 385 ASSERT_TRUE(dispatcher); |
389 | 386 |
390 // Make a mapping. | 387 // Make a mapping. |
391 scoped_ptr<RawSharedBufferMapping> mapping; | 388 scoped_ptr<RawSharedBufferMapping> mapping; |
392 EXPECT_EQ(MOJO_RESULT_OK, | 389 EXPECT_EQ(MOJO_RESULT_OK, |
393 dispatcher->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 390 dispatcher->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); |
394 ASSERT_TRUE(mapping); | 391 ASSERT_TRUE(mapping); |
395 ASSERT_TRUE(mapping->base()); | 392 ASSERT_TRUE(mapping->base()); |
396 ASSERT_EQ(100u, mapping->length()); | 393 ASSERT_EQ(100u, mapping->length()); |
397 | 394 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 WaitIfNecessary(mp, MOJO_WAIT_FLAG_READABLE)); | 545 WaitIfNecessary(mp, MOJO_WAIT_FLAG_READABLE)); |
549 | 546 |
550 mp->Close(0); | 547 mp->Close(0); |
551 | 548 |
552 EXPECT_EQ(0, helper()->WaitForChildShutdown()); | 549 EXPECT_EQ(0, helper()->WaitForChildShutdown()); |
553 } | 550 } |
554 | 551 |
555 } // namespace | 552 } // namespace |
556 } // namespace system | 553 } // namespace system |
557 } // namespace mojo | 554 } // namespace mojo |
OLD | NEW |