OLD | NEW |
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 #include "components/metrics/child_call_stack_profile_collector.h" | 5 #include "components/metrics/child_call_stack_profile_collector.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const std::vector<ChildCallStackProfileCollector::ProfilesState>& | 66 const std::vector<ChildCallStackProfileCollector::ProfilesState>& |
67 profiles() const { | 67 profiles() const { |
68 return child_collector_.profiles_; | 68 return child_collector_.profiles_; |
69 } | 69 } |
70 | 70 |
71 base::MessageLoop loop_; | 71 base::MessageLoop loop_; |
72 mojom::CallStackProfileCollectorPtr receiver_; | 72 mojom::CallStackProfileCollectorPtr receiver_; |
73 std::unique_ptr<Receiver> receiver_impl_; | 73 std::unique_ptr<Receiver> receiver_impl_; |
74 ChildCallStackProfileCollector child_collector_; | 74 ChildCallStackProfileCollector child_collector_; |
75 | 75 |
| 76 private: |
76 DISALLOW_COPY_AND_ASSIGN(ChildCallStackProfileCollectorTest); | 77 DISALLOW_COPY_AND_ASSIGN(ChildCallStackProfileCollectorTest); |
77 }; | 78 }; |
78 | 79 |
79 // Test the behavior when an interface is provided. | 80 // Test the behavior when an interface is provided. |
80 TEST_F(ChildCallStackProfileCollectorTest, InterfaceProvided) { | 81 TEST_F(ChildCallStackProfileCollectorTest, InterfaceProvided) { |
81 EXPECT_EQ(0u, profiles().size()); | 82 EXPECT_EQ(0u, profiles().size()); |
82 | 83 |
83 // Add profiles before providing the interface. | 84 // Add profiles before providing the interface. |
84 CollectEmptyProfiles( | 85 CollectEmptyProfiles( |
85 CallStackProfileParams(CallStackProfileParams::BROWSER_PROCESS, | 86 CallStackProfileParams(CallStackProfileParams::BROWSER_PROCESS, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 CollectEmptyProfiles( | 169 CollectEmptyProfiles( |
169 CallStackProfileParams(CallStackProfileParams::GPU_PROCESS, | 170 CallStackProfileParams(CallStackProfileParams::GPU_PROCESS, |
170 CallStackProfileParams::GPU_MAIN_THREAD, | 171 CallStackProfileParams::GPU_MAIN_THREAD, |
171 CallStackProfileParams::THREAD_HUNG, | 172 CallStackProfileParams::THREAD_HUNG, |
172 CallStackProfileParams::PRESERVE_ORDER), | 173 CallStackProfileParams::PRESERVE_ORDER), |
173 1); | 174 1); |
174 EXPECT_EQ(0u, profiles().size()); | 175 EXPECT_EQ(0u, profiles().size()); |
175 } | 176 } |
176 | 177 |
177 } // namespace metrics | 178 } // namespace metrics |
OLD | NEW |