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 "apps/app_window_contents.h" | |
8 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 8 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
10 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/test/base/browser_with_test_window_test.h" | 11 #include "chrome/test/base/browser_with_test_window_test.h" |
13 #include "chrome/test/base/testing_browser_process.h" | 12 #include "chrome/test/base/testing_browser_process.h" |
14 #include "chrome/test/base/testing_profile_manager.h" | 13 #include "chrome/test/base/testing_profile_manager.h" |
15 #include "components/power/origin_power_map.h" | 14 #include "components/power/origin_power_map.h" |
16 #include "components/power/origin_power_map_factory.h" | 15 #include "components/power/origin_power_map_factory.h" |
17 #include "content/public/browser/site_instance.h" | 16 #include "content/public/browser/site_instance.h" |
18 #include "content/public/test/browser_test_utils.h" | 17 #include "content/public/test/browser_test_utils.h" |
19 #include "content/public/test/mock_render_process_host.h" | 18 #include "content/public/test/mock_render_process_host.h" |
| 19 #include "extensions/browser/app_window/app_window_contents.h" |
20 #include "extensions/browser/app_window/app_window_registry.h" | 20 #include "extensions/browser/app_window/app_window_registry.h" |
21 #include "extensions/browser/app_window/apps_client.h" | 21 #include "extensions/browser/app_window/apps_client.h" |
22 #include "extensions/browser/app_window/native_app_window.h" | 22 #include "extensions/browser/app_window/native_app_window.h" |
23 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
26 | 26 |
27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
28 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" | 28 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
29 #endif | 29 #endif |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 collector->UpdatePowerConsumptionForTesting(); | 312 collector->UpdatePowerConsumptionForTesting(); |
313 EXPECT_EQ(1u, collector->metrics_map_for_testing()->size()); | 313 EXPECT_EQ(1u, collector->metrics_map_for_testing()->size()); |
314 | 314 |
315 // Clear the AppWindowContents before trying to close. | 315 // Clear the AppWindowContents before trying to close. |
316 window->SetAppWindowContentsForTesting( | 316 window->SetAppWindowContentsForTesting( |
317 scoped_ptr<extensions::AppWindowContents>()); | 317 scoped_ptr<extensions::AppWindowContents>()); |
318 window->OnNativeClose(); | 318 window->OnNativeClose(); |
319 collector->UpdatePowerConsumptionForTesting(); | 319 collector->UpdatePowerConsumptionForTesting(); |
320 EXPECT_EQ(0u, collector->metrics_map_for_testing()->size()); | 320 EXPECT_EQ(0u, collector->metrics_map_for_testing()->size()); |
321 } | 321 } |
OLD | NEW |