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 // This tests the performance of the C API. | 5 // This tests the performance of the C API. |
6 | 6 |
7 #include "third_party/mojo/src/mojo/public/c/system/core.h" | 7 #include "mojo/public/c/system/core.h" |
8 | 8 |
9 #include <assert.h> | 9 #include <assert.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 | 12 |
| 13 #include "mojo/public/cpp/system/macros.h" |
| 14 #include "mojo/public/cpp/test_support/test_support.h" |
| 15 #include "mojo/public/cpp/test_support/test_utils.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" | |
15 #include "third_party/mojo/src/mojo/public/cpp/test_support/test_support.h" | |
16 #include "third_party/mojo/src/mojo/public/cpp/test_support/test_utils.h" | |
17 | 17 |
18 // TODO(vtl): (here and below) crbug.com/342893 | 18 // TODO(vtl): (here and below) crbug.com/342893 |
19 #if !defined(WIN32) | 19 #if !defined(WIN32) |
20 #include <time.h> | 20 #include <time.h> |
21 #include "third_party/mojo/src/mojo/public/cpp/utility/thread.h" | 21 #include "mojo/public/cpp/utility/thread.h" |
22 #endif // !defined(WIN32) | 22 #endif // !defined(WIN32) |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 #if !defined(WIN32) | 26 #if !defined(WIN32) |
27 class MessagePipeWriterThread : public mojo::Thread { | 27 class MessagePipeWriterThread : public mojo::Thread { |
28 public: | 28 public: |
29 MessagePipeWriterThread(MojoHandle handle, uint32_t num_bytes) | 29 MessagePipeWriterThread(MojoHandle handle, uint32_t num_bytes) |
30 : handle_(handle), num_bytes_(num_bytes), num_writes_(0) {} | 30 : handle_(handle), num_bytes_(num_bytes), num_writes_(0) {} |
31 ~MessagePipeWriterThread() override {} | 31 ~MessagePipeWriterThread() override {} |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 DoMessagePipeThreadedTest(1u, 1u, 10000u); | 316 DoMessagePipeThreadedTest(1u, 1u, 10000u); |
317 | 317 |
318 DoMessagePipeThreadedTest(3u, 3u, 10u); | 318 DoMessagePipeThreadedTest(3u, 3u, 10u); |
319 // 100 was done above. | 319 // 100 was done above. |
320 DoMessagePipeThreadedTest(3u, 3u, 1000u); | 320 DoMessagePipeThreadedTest(3u, 3u, 1000u); |
321 DoMessagePipeThreadedTest(3u, 3u, 10000u); | 321 DoMessagePipeThreadedTest(3u, 3u, 10000u); |
322 } | 322 } |
323 #endif // !defined(WIN32) | 323 #endif // !defined(WIN32) |
324 | 324 |
325 } // namespace | 325 } // namespace |
OLD | NEW |