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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 // Now port 1 should no longer be readable. | 401 // Now port 1 should no longer be readable. |
402 hss = MojoHandleSignalsState(); | 402 hss = MojoHandleSignalsState(); |
403 ASSERT_EQ(MOJO_RESULT_FAILED_PRECONDITION, | 403 ASSERT_EQ(MOJO_RESULT_FAILED_PRECONDITION, |
404 MojoWait(pipe1_, MOJO_HANDLE_SIGNAL_READABLE, | 404 MojoWait(pipe1_, MOJO_HANDLE_SIGNAL_READABLE, |
405 MOJO_DEADLINE_INDEFINITE, &hss)); | 405 MOJO_DEADLINE_INDEFINITE, &hss)); |
406 ASSERT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals); | 406 ASSERT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals); |
407 ASSERT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); | 407 ASSERT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); |
408 } | 408 } |
409 | 409 |
| 410 #if !defined(OS_IOS) |
| 411 |
410 const size_t kPingPongIterations = 50000; | 412 const size_t kPingPongIterations = 50000; |
411 | 413 |
412 DEFINE_TEST_CLIENT_TEST_WITH_PIPE(DataPipeHandlePingPong, MessagePipeTest, h) { | 414 DEFINE_TEST_CLIENT_TEST_WITH_PIPE(DataPipeHandlePingPong, MessagePipeTest, h) { |
413 // Wait for the consumer to become readable. | 415 // Wait for the consumer to become readable. |
414 for (size_t i = 0; i < kPingPongIterations; i++) { | 416 for (size_t i = 0; i < kPingPongIterations; i++) { |
415 MojoHandle handle; | 417 MojoHandle handle; |
416 ReadMessageWithHandles(h, &handle, 1); | 418 ReadMessageWithHandles(h, &handle, 1); |
417 WriteMessageWithHandles(h, "", &handle, 1); | 419 WriteMessageWithHandles(h, "", &handle, 1); |
418 } | 420 } |
419 } | 421 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 455 |
454 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) | 456 RUN_CHILD_ON_PIPE(DataPipeHandlePingPong, h) |
455 for (size_t i = 0; i < kPingPongIterations; i++) { | 457 for (size_t i = 0; i < kPingPongIterations; i++) { |
456 WriteMessageWithHandles(h, "", &buffer, 1); | 458 WriteMessageWithHandles(h, "", &buffer, 1); |
457 ReadMessageWithHandles(h, &buffer, 1); | 459 ReadMessageWithHandles(h, &buffer, 1); |
458 } | 460 } |
459 END_CHILD() | 461 END_CHILD() |
460 MojoClose(buffer); | 462 MojoClose(buffer); |
461 } | 463 } |
462 | 464 |
| 465 #endif // !defined(OS_IOS) |
| 466 |
463 } // namespace | 467 } // namespace |
464 } // namespace edk | 468 } // namespace edk |
465 } // namespace mojo | 469 } // namespace mojo |
OLD | NEW |