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

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

Issue 1676913002: [mojo] Delete third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's try that again Created 4 years, 10 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
« no previous file with comments | « mojo/edk/system/message_pipe_test_utils.cc ('k') | mojo/edk/system/shared_buffer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_test_utils.cc ('k') | mojo/edk/system/shared_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698