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

Side by Side Diff: mojo/public/c/tests/system/wait_set_perftest.cc

Issue 2244503002: mojo/public: Include gtest.h as "gtest/gtest.h", instead of via "absolute" path. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 wait sets via the C API. 5 // This tests the performance of wait sets via the C API.
6 6
7 #include <mojo/system/wait_set.h> 7 #include <mojo/system/wait_set.h>
8 8
9 #include <assert.h> 9 #include <assert.h>
10 #include <mojo/macros.h> 10 #include <mojo/macros.h>
11 #include <mojo/result.h> 11 #include <mojo/result.h>
12 #include <mojo/system/handle.h> 12 #include <mojo/system/handle.h>
13 #include <mojo/system/message_pipe.h> 13 #include <mojo/system/message_pipe.h>
14 #include <stdint.h> 14 #include <stdint.h>
15 #include <stdio.h> 15 #include <stdio.h>
16 16
17 #include <atomic> 17 #include <atomic>
18 #include <thread> 18 #include <thread>
19 #include <vector> 19 #include <vector>
20 20
21 #include "gtest/gtest.h"
21 #include "mojo/public/c/tests/system/perftest_utils.h" 22 #include "mojo/public/c/tests/system/perftest_utils.h"
22 #include "mojo/public/cpp/test_support/test_support.h" 23 #include "mojo/public/cpp/test_support/test_support.h"
23 #include "testing/gtest/include/gtest/gtest.h"
24 24
25 namespace { 25 namespace {
26 26
27 // Creates a wait set, creates a bunch of message pipes, and populates the wait 27 // Creates a wait set, creates a bunch of message pipes, and populates the wait
28 // set with entries. There will be |num_entries| entries; the |i|-th entry will 28 // set with entries. There will be |num_entries| entries; the |i|-th entry will
29 // be given cookie |i| and will be watching for readability on the message pipe 29 // be given cookie |i| and will be watching for readability on the message pipe
30 // endpoint |h0s->at(i)| whose corresponding endpoint is |h1s->at(i)|. 30 // endpoint |h0s->at(i)| whose corresponding endpoint is |h1s->at(i)|.
31 void CreateAndPopulateWaitSet(unsigned num_entries, 31 void CreateAndPopulateWaitSet(unsigned num_entries,
32 MojoHandle* wait_set, 32 MojoHandle* wait_set,
33 std::vector<MojoHandle>* h0s, 33 std::vector<MojoHandle>* h0s,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 TEST(WaitSetPerftest, ThreadedWait) { 172 TEST(WaitSetPerftest, ThreadedWait) {
173 DoWaitSetThreadedWaitTest(10u); 173 DoWaitSetThreadedWaitTest(10u);
174 DoWaitSetThreadedWaitTest(100u); 174 DoWaitSetThreadedWaitTest(100u);
175 DoWaitSetThreadedWaitTest(1000u); 175 DoWaitSetThreadedWaitTest(1000u);
176 DoWaitSetThreadedWaitTest(10000u); 176 DoWaitSetThreadedWaitTest(10000u);
177 } 177 }
178 178
179 } // namespace 179 } // namespace
OLDNEW
« no previous file with comments | « mojo/public/c/tests/system/time_unittest.cc ('k') | mojo/public/c/tests/system/wait_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698