OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bindings/binding.h" | 5 #include "mojo/public/cpp/bindings/binding.h" |
6 #include "mojo/public/cpp/test_support/test_support.h" | 6 #include "mojo/public/cpp/test_support/test_support.h" |
7 #include "mojo/public/cpp/utility/run_loop.h" | 7 #include "mojo/public/cpp/utility/run_loop.h" |
8 #include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h" | 8 #include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 binding.Bind(GetProxy(&service)); | 76 binding.Bind(GetProxy(&service)); |
77 } | 77 } |
78 | 78 |
79 PingServiceImpl impl; | 79 PingServiceImpl impl; |
80 test::PingServicePtr service; | 80 test::PingServicePtr service; |
81 Binding<test::PingService> binding; | 81 Binding<test::PingService> binding; |
82 }; | 82 }; |
83 | 83 |
84 class MojoBindingsPerftest : public testing::Test { | 84 class MojoBindingsPerftest : public testing::Test { |
85 protected: | 85 protected: |
86 Environment env_; | |
87 RunLoop run_loop_; | 86 RunLoop run_loop_; |
88 }; | 87 }; |
89 | 88 |
90 TEST_F(MojoBindingsPerftest, InProcessPingPong) { | 89 TEST_F(MojoBindingsPerftest, InProcessPingPong) { |
91 test::PingServicePtr service; | 90 test::PingServicePtr service; |
92 PingServiceImpl impl; | 91 PingServiceImpl impl; |
93 Binding<test::PingService> binding(&impl, GetProxy(&service)); | 92 Binding<test::PingService> binding(&impl, GetProxy(&service)); |
94 PingPongTest test(service.Pass()); | 93 PingPongTest test(service.Pass()); |
95 | 94 |
96 { | 95 { |
(...skipping 20 matching lines...) Expand all Loading... |
117 "InProcessPingPong", "1000_Inactive", | 116 "InProcessPingPong", "1000_Inactive", |
118 kIterations / MojoTicksToSeconds(end_time - start_time), | 117 kIterations / MojoTicksToSeconds(end_time - start_time), |
119 "pings/second"); | 118 "pings/second"); |
120 | 119 |
121 delete[] inactive_services; | 120 delete[] inactive_services; |
122 } | 121 } |
123 } | 122 } |
124 | 123 |
125 } // namespace | 124 } // namespace |
126 } // namespace mojo | 125 } // namespace mojo |
OLD | NEW |