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

Side by Side Diff: mojo/edk/system/message_pipe_unittest.cc

Issue 1910233003: Implement a new child test helper for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 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
OLDNEW
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 <string.h> 6 #include <string.h>
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "mojo/edk/system/test_utils.h" 9 #include "mojo/edk/system/test_utils.h"
10 #include "mojo/edk/test/mojo_test_base.h" 10 #include "mojo/edk/test/mojo_test_base.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 for (size_t i = 0; i < kPingPongIterations; i++) { 527 for (size_t i = 0; i < kPingPongIterations; i++) {
528 WriteMessageWithHandles(h, "", p, kPingPongHandlesPerIteration); 528 WriteMessageWithHandles(h, "", p, kPingPongHandlesPerIteration);
529 ReadMessageWithHandles(h, p, kPingPongHandlesPerIteration); 529 ReadMessageWithHandles(h, p, kPingPongHandlesPerIteration);
530 } 530 }
531 WriteMessage(h, "quit", 4); 531 WriteMessage(h, "quit", 4);
532 END_CHILD() 532 END_CHILD()
533 for (size_t i = 0; i < kPingPongHandlesPerIteration; ++i) 533 for (size_t i = 0; i < kPingPongHandlesPerIteration; ++i)
534 MojoClose(p[i]); 534 MojoClose(p[i]);
535 } 535 }
536 536
537 #if defined(OS_ANDROID) 537 TEST_F(MessagePipeTest, SharedBufferHandlePingPong) {
538 // Android multi-process tests are not executing the new process. This is flaky.
539 #define MAYBE_SharedBufferHandlePingPong DISABLED_SharedBufferHandlePingPong
540 #else
541 #define MAYBE_SharedBufferHandlePingPong SharedBufferHandlePingPong
542 #endif
543 TEST_F(MessagePipeTest, MAYBE_SharedBufferHandlePingPong) {
544 MojoHandle buffers[kPingPongHandlesPerIteration]; 538 MojoHandle buffers[kPingPongHandlesPerIteration];
545 for (size_t i = 0; i <kPingPongHandlesPerIteration; ++i) 539 for (size_t i = 0; i <kPingPongHandlesPerIteration; ++i)
546 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateSharedBuffer(nullptr, 1, &buffers[i])); 540 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateSharedBuffer(nullptr, 1, &buffers[i]));
547 541
548 RUN_CHILD_ON_PIPE(HandlePingPong, h) 542 RUN_CHILD_ON_PIPE(HandlePingPong, h)
549 for (size_t i = 0; i < kPingPongIterations; i++) { 543 for (size_t i = 0; i < kPingPongIterations; i++) {
550 WriteMessageWithHandles(h, "", buffers, kPingPongHandlesPerIteration); 544 WriteMessageWithHandles(h, "", buffers, kPingPongHandlesPerIteration);
551 ReadMessageWithHandles(h, buffers, kPingPongHandlesPerIteration); 545 ReadMessageWithHandles(h, buffers, kPingPongHandlesPerIteration);
552 } 546 }
553 WriteMessage(h, "quit", 4); 547 WriteMessage(h, "quit", 4);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 EXPECT_EQ(kTestMessage, ReadMessage(d)); 702 EXPECT_EQ(kTestMessage, ReadMessage(d));
709 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(d, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 703 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(d, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
710 MOJO_DEADLINE_INDEFINITE, nullptr)); 704 MOJO_DEADLINE_INDEFINITE, nullptr));
711 705
712 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(d)); 706 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(d));
713 } 707 }
714 708
715 } // namespace 709 } // namespace
716 } // namespace edk 710 } // namespace edk
717 } // namespace mojo 711 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe_unittest.cc ('k') | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698