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

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

Issue 2514553002: Mojo EDK: Work around Nexus 9 hardware bug (Closed)
Patch Set: . Created 4 years, 1 month 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 | « no previous file | mojo/edk/system/ports/node.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 #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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(b)); 699 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(b));
700 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(c)); 700 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(c));
701 701
702 EXPECT_EQ(kTestMessage, ReadMessage(d)); 702 EXPECT_EQ(kTestMessage, ReadMessage(d));
703 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,
704 MOJO_DEADLINE_INDEFINITE, nullptr)); 704 MOJO_DEADLINE_INDEFINITE, nullptr));
705 705
706 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(d)); 706 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(d));
707 } 707 }
708 708
709 TEST_F(MessagePipeTest, ClosePipesStressTest) {
710 // Stress test to exercise https://crbug.com/665869.
711 const size_t kNumPipes = 100000;
712 for (size_t i = 0; i < kNumPipes; ++i) {
713 MojoHandle a, b;
714 CreateMessagePipe(&a, &b);
715 MojoClose(a);
716 MojoClose(b);
717 }
718 }
719
709 } // namespace 720 } // namespace
710 } // namespace edk 721 } // namespace edk
711 } // namespace mojo 722 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/ports/node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698