| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
| 7 #include "content/public/browser/render_view_host.h" | 7 #include "content/public/browser/render_view_host.h" |
| 8 #include "content/public/common/web_preferences.h" | 8 #include "content/public/common/web_preferences.h" |
| 9 #include "extensions/browser/extension_host.h" | 9 #include "extensions/browser/extension_host.h" |
| 10 #include "extensions/browser/extension_system.h" | |
| 11 #include "extensions/browser/process_manager.h" | 10 #include "extensions/browser/process_manager.h" |
| 12 | 11 |
| 13 // Tests that background pages are marked as never visible to prevent GPU | 12 // Tests that background pages are marked as never visible to prevent GPU |
| 14 // resource allocation. See crbug.com/362165 and crbug.com/163698. | 13 // resource allocation. See crbug.com/362165 and crbug.com/163698. |
| 15 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, BackgroundPageIsNeverVisible) { | 14 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, BackgroundPageIsNeverVisible) { |
| 16 ASSERT_TRUE(LoadExtension( | 15 ASSERT_TRUE(LoadExtension( |
| 17 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") | 16 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") |
| 18 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 17 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 19 .AppendASCII("1.0.0.0"))); | 18 .AppendASCII("1.0.0.0"))); |
| 20 | 19 |
| 21 extensions::ProcessManager* manager = | 20 extensions::ProcessManager* manager = |
| 22 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); | 21 extensions::ProcessManager::Get(browser()->profile()); |
| 23 extensions::ExtensionHost* host = | 22 extensions::ExtensionHost* host = |
| 24 FindHostWithPath(manager, "/backgroundpage.html", 1); | 23 FindHostWithPath(manager, "/backgroundpage.html", 1); |
| 25 ASSERT_TRUE(host->host_contents()->GetDelegate()->IsNeverVisible( | 24 ASSERT_TRUE(host->host_contents()->GetDelegate()->IsNeverVisible( |
| 26 host->host_contents())); | 25 host->host_contents())); |
| 27 } | 26 } |
| OLD | NEW |