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 "mojo/public/cpp/test_support/test_utils.h" | 5 #include "mojo/public/cpp/test_support/test_utils.h" |
6 | 6 |
7 #include "mojo/public/cpp/system/core.h" | 7 #include "mojo/public/cpp/system/core.h" |
8 #include "mojo/public/cpp/test_support/test_support.h" | 8 #include "mojo/public/cpp/test_support/test_support.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
(...skipping 20 matching lines...) Expand all Loading... |
31 nullptr, | 31 nullptr, |
32 &num_bytes, | 32 &num_bytes, |
33 nullptr, | 33 nullptr, |
34 &num_handles, | 34 &num_handles, |
35 MOJO_READ_MESSAGE_FLAG_NONE); | 35 MOJO_READ_MESSAGE_FLAG_NONE); |
36 if (rv == MOJO_RESULT_SHOULD_WAIT) { | 36 if (rv == MOJO_RESULT_SHOULD_WAIT) { |
37 if (did_wait) { | 37 if (did_wait) { |
38 assert(false); // Looping endlessly!? | 38 assert(false); // Looping endlessly!? |
39 return false; | 39 return false; |
40 } | 40 } |
41 rv = Wait(handle, MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE); | 41 rv = Wait(handle, MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE, |
| 42 nullptr); |
42 if (rv != MOJO_RESULT_OK) | 43 if (rv != MOJO_RESULT_OK) |
43 return false; | 44 return false; |
44 did_wait = true; | 45 did_wait = true; |
45 } else { | 46 } else { |
46 assert(!num_handles); | 47 assert(!num_handles); |
47 break; | 48 break; |
48 } | 49 } |
49 } | 50 } |
50 | 51 |
51 text->resize(num_bytes); | 52 text->resize(num_bytes); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 end_time = GetTimeTicksNow(); | 88 end_time = GetTimeTicksNow(); |
88 } while (end_time - start_time < kPerftestTimeMicroseconds); | 89 } while (end_time - start_time < kPerftestTimeMicroseconds); |
89 | 90 |
90 MojoTestSupportLogPerfResult(test_name, sub_test_name, | 91 MojoTestSupportLogPerfResult(test_name, sub_test_name, |
91 1000000.0 * iterations / (end_time - start_time), | 92 1000000.0 * iterations / (end_time - start_time), |
92 "iterations/second"); | 93 "iterations/second"); |
93 } | 94 } |
94 | 95 |
95 } // namespace test | 96 } // namespace test |
96 } // namespace mojo | 97 } // namespace mojo |
OLD | NEW |