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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "content/browser/browser_thread_impl.h" | 7 #include "content/browser/browser_thread_impl.h" |
8 #include "content/browser/power_profiler/power_profiler_service.h" | 8 #include "content/browser/power_profiler/power_profiler_service.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 events.push_back(event); | 33 events.push_back(event); |
34 | 34 |
35 num_events_to_send_--; | 35 num_events_to_send_--; |
36 return events; | 36 return events; |
37 } | 37 } |
38 | 38 |
39 virtual base::TimeDelta GetSamplingRate() OVERRIDE { | 39 virtual base::TimeDelta GetSamplingRate() OVERRIDE { |
40 return base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs); | 40 return base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs); |
41 } | 41 } |
42 | 42 |
| 43 virtual AccuracyLevel GetAccuracyLevel() { return High; } |
| 44 |
43 private: | 45 private: |
44 int num_events_to_send_; | 46 int num_events_to_send_; |
45 DISALLOW_COPY_AND_ASSIGN(TestPowerDataProvider); | 47 DISALLOW_COPY_AND_ASSIGN(TestPowerDataProvider); |
46 }; | 48 }; |
47 | 49 |
48 class TestPowerProfilerObserver : public PowerProfilerObserver { | 50 class TestPowerProfilerObserver : public PowerProfilerObserver { |
49 public: | 51 public: |
50 TestPowerProfilerObserver() | 52 TestPowerProfilerObserver() |
51 : valid_event_count_(0), | 53 : valid_event_count_(0), |
52 total_num_events_received_(0) {} | 54 total_num_events_received_(0) {} |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 136 |
135 ServiceStartTest(); | 137 ServiceStartTest(); |
136 AddObserverTest(); | 138 AddObserverTest(); |
137 | 139 |
138 run_loop.Run(); | 140 run_loop.Run(); |
139 | 141 |
140 RemoveObserverTest(); | 142 RemoveObserverTest(); |
141 } | 143 } |
142 | 144 |
143 } // namespace content | 145 } // namespace content |
OLD | NEW |