OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/lazy_instance.h" | 5 #include "base/lazy_instance.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "ipc/ipc_perftest_support.h" | 7 #include "ipc/ipc_perftest_support.h" |
8 #include "ipc/mojo/ipc_channel_mojo.h" | 8 #include "ipc/mojo/ipc_channel_mojo.h" |
9 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" | 9 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 MojoChannelPerfTest(); | 30 MojoChannelPerfTest(); |
31 | 31 |
32 void TearDown() override { | 32 void TearDown() override { |
33 IPC::test::IPCChannelPerfTestBase::TearDown(); | 33 IPC::test::IPCChannelPerfTestBase::TearDown(); |
34 } | 34 } |
35 | 35 |
36 scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( | 36 scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( |
37 const IPC::ChannelHandle& handle, | 37 const IPC::ChannelHandle& handle, |
38 base::SequencedTaskRunner* runner) override { | 38 base::SequencedTaskRunner* runner) override { |
39 return IPC::ChannelMojo::CreateServerFactory(runner, handle, nullptr); | 39 return IPC::ChannelMojo::CreateServerFactory(runner, handle); |
40 } | 40 } |
41 | 41 |
42 bool DidStartClient() override { | 42 bool DidStartClient() override { |
43 bool ok = IPCTestBase::DidStartClient(); | 43 bool ok = IPCTestBase::DidStartClient(); |
44 DCHECK(ok); | 44 DCHECK(ok); |
45 return ok; | 45 return ok; |
46 } | 46 } |
47 }; | 47 }; |
48 | 48 |
49 MojoChannelPerfTest::MojoChannelPerfTest() { | 49 MojoChannelPerfTest::MojoChannelPerfTest() { |
(...skipping 25 matching lines...) Expand all Loading... |
75 }; | 75 }; |
76 | 76 |
77 MojoTestClient::MojoTestClient() { | 77 MojoTestClient::MojoTestClient() { |
78 g_mojo_initializer.Get(); | 78 g_mojo_initializer.Get(); |
79 } | 79 } |
80 | 80 |
81 scoped_ptr<IPC::Channel> MojoTestClient::CreateChannel( | 81 scoped_ptr<IPC::Channel> MojoTestClient::CreateChannel( |
82 IPC::Listener* listener) { | 82 IPC::Listener* listener) { |
83 return scoped_ptr<IPC::Channel>(IPC::ChannelMojo::Create( | 83 return scoped_ptr<IPC::Channel>(IPC::ChannelMojo::Create( |
84 task_runner(), IPCTestBase::GetChannelName("PerformanceClient"), | 84 task_runner(), IPCTestBase::GetChannelName("PerformanceClient"), |
85 IPC::Channel::MODE_CLIENT, listener, nullptr)); | 85 IPC::Channel::MODE_CLIENT, listener)); |
86 } | 86 } |
87 | 87 |
88 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(PerformanceClient) { | 88 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(PerformanceClient) { |
89 MojoTestClient client; | 89 MojoTestClient client; |
90 int rv = client.RunMain(); | 90 int rv = client.RunMain(); |
91 | 91 |
92 base::RunLoop run_loop; | 92 base::RunLoop run_loop; |
93 run_loop.RunUntilIdle(); | 93 run_loop.RunUntilIdle(); |
94 | 94 |
95 return rv; | 95 return rv; |
96 } | 96 } |
97 | 97 |
98 } // namespace | 98 } // namespace |
OLD | NEW |