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 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "mojo/edk/system/test_utils.h" | 8 #include "mojo/edk/system/test_utils.h" |
9 #include "mojo/edk/test/mojo_test_base.h" | 9 #include "mojo/edk/test/mojo_test_base.h" |
10 #include "mojo/public/c/system/core.h" | 10 #include "mojo/public/c/system/core.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 DEFINE_TEST_CLIENT_TEST_WITH_PIPE(DataPipeHandlePingPong, MessagePipeTest, h) { | 414 DEFINE_TEST_CLIENT_TEST_WITH_PIPE(DataPipeHandlePingPong, MessagePipeTest, h) { |
415 // Wait for the consumer to become readable. | 415 // Wait for the consumer to become readable. |
416 for (size_t i = 0; i < kPingPongIterations; i++) { | 416 for (size_t i = 0; i < kPingPongIterations; i++) { |
417 MojoHandle handle; | 417 MojoHandle handle; |
418 ReadMessageWithHandles(h, &handle, 1); | 418 ReadMessageWithHandles(h, &handle, 1); |
419 WriteMessageWithHandles(h, "", &handle, 1); | 419 WriteMessageWithHandles(h, "", &handle, 1); |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 // Test that sending a data pipe handle across processes doesn't leak resources. | 423 // Test that sending a data pipe handle across processes doesn't leak resources. |
424 TEST_F(MessagePipeTest, DataPipeConsumerHandlePingPong) { | 424 // Currently times out on multiple platforms. crbug.com/585784 |
| 425 TEST_F(MessagePipeTest, DISABLED_DataPipeConsumerHandlePingPong) { |
425 MojoHandle p, c; | 426 MojoHandle p, c; |
426 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &p, &c)); | 427 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &p, &c)); |
427 MojoClose(p); | 428 MojoClose(p); |
428 | 429 |
429 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) | 430 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) |
430 for (size_t i = 0; i < kPingPongIterations; i++) { | 431 for (size_t i = 0; i < kPingPongIterations; i++) { |
431 WriteMessageWithHandles(h, "", &c, 1); | 432 WriteMessageWithHandles(h, "", &c, 1); |
432 ReadMessageWithHandles(h, &c, 1); | 433 ReadMessageWithHandles(h, &c, 1); |
433 } | 434 } |
434 END_CHILD() | 435 END_CHILD() |
435 MojoClose(c); | 436 MojoClose(c); |
436 } | 437 } |
437 | 438 |
438 TEST_F(MessagePipeTest, DataPipeProducerHandlePingPong) { | 439 // Currently times out on multiple platforms. crbug.com/585784 |
| 440 TEST_F(MessagePipeTest, DISABLED_DataPipeProducerHandlePingPong) { |
439 MojoHandle p, c; | 441 MojoHandle p, c; |
440 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &p, &c)); | 442 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &p, &c)); |
441 MojoClose(c); | 443 MojoClose(c); |
442 | 444 |
443 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) | 445 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) |
444 for (size_t i = 0; i < kPingPongIterations; i++) { | 446 for (size_t i = 0; i < kPingPongIterations; i++) { |
445 WriteMessageWithHandles(h, "", &p, 1); | 447 WriteMessageWithHandles(h, "", &p, 1); |
446 ReadMessageWithHandles(h, &p, 1); | 448 ReadMessageWithHandles(h, &p, 1); |
447 } | 449 } |
448 END_CHILD() | 450 END_CHILD() |
(...skipping 11 matching lines...) Expand all Loading... |
460 } | 462 } |
461 END_CHILD() | 463 END_CHILD() |
462 MojoClose(buffer); | 464 MojoClose(buffer); |
463 } | 465 } |
464 | 466 |
465 #endif // !defined(OS_IOS) | 467 #endif // !defined(OS_IOS) |
466 | 468 |
467 } // namespace | 469 } // namespace |
468 } // namespace edk | 470 } // namespace edk |
469 } // namespace mojo | 471 } // namespace mojo |
OLD | NEW |