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 "chrome/browser/power/process_power_collector.h" | 5 #include "chrome/browser/power/process_power_collector.h" |
6 | 6 |
| 7 #include "build/build_config.h" |
7 #include "chrome/browser/apps/scoped_keep_alive.h" | 8 #include "chrome/browser/apps/scoped_keep_alive.h" |
8 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 10 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
10 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/test/base/browser_with_test_window_test.h" | 13 #include "chrome/test/base/browser_with_test_window_test.h" |
13 #include "chrome/test/base/testing_browser_process.h" | 14 #include "chrome/test/base/testing_browser_process.h" |
14 #include "chrome/test/base/testing_profile_manager.h" | 15 #include "chrome/test/base/testing_profile_manager.h" |
15 #include "components/power/origin_power_map.h" | 16 #include "components/power/origin_power_map.h" |
16 #include "components/power/origin_power_map_factory.h" | 17 #include "components/power/origin_power_map_factory.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 base::Bind(&BrowserProcessPowerTest::ReturnCpuAsConstant, | 288 base::Bind(&BrowserProcessPowerTest::ReturnCpuAsConstant, |
288 base::Unretained(this), | 289 base::Unretained(this), |
289 5)); | 290 5)); |
290 collector->UpdatePowerConsumptionForTesting(); | 291 collector->UpdatePowerConsumptionForTesting(); |
291 EXPECT_EQ(1u, collector->metrics_map_for_testing()->size()); | 292 EXPECT_EQ(1u, collector->metrics_map_for_testing()->size()); |
292 | 293 |
293 window->OnNativeClose(); | 294 window->OnNativeClose(); |
294 collector->UpdatePowerConsumptionForTesting(); | 295 collector->UpdatePowerConsumptionForTesting(); |
295 EXPECT_EQ(0u, collector->metrics_map_for_testing()->size()); | 296 EXPECT_EQ(0u, collector->metrics_map_for_testing()->size()); |
296 } | 297 } |
OLD | NEW |