blob: 93df6f34e3fe1252e603980845e57ca4558a585f [file] [log] [blame]
[email protected]fad73672012-06-15 23:26:061// 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
3// found in the LICENSE file.
4
[email protected]fad73672012-06-15 23:26:065#include "chrome/browser/extensions/extension_browsertest.h"
[email protected]fad73672012-06-15 23:26:066#include "chrome/browser/ui/browser.h"
7#include "content/public/browser/render_view_host.h"
[email protected]b3a97b52014-07-09 06:25:058#include "content/public/common/web_preferences.h"
[email protected]22401dc2014-03-21 01:38:579#include "extensions/browser/extension_host.h"
[email protected]98b6d942013-11-10 00:34:0710#include "extensions/browser/process_manager.h"
[email protected]fad73672012-06-15 23:26:0611
Devlin Cronin836f545d2018-05-09 00:25:0512namespace extensions {
13
[email protected]7912e822014-04-16 02:37:0314// Tests that background pages are marked as never visible to prevent GPU
15// resource allocation. See crbug.com/362165 and crbug.com/163698.
16IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, BackgroundPageIsNeverVisible) {
[email protected]fad73672012-06-15 23:26:0617 ASSERT_TRUE(LoadExtension(
18 test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
19 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
20 .AppendASCII("1.0.0.0")));
21
Devlin Cronin836f545d2018-05-09 00:25:0522 ProcessManager* manager = ProcessManager::Get(browser()->profile());
23 ExtensionHost* host = FindHostWithPath(manager, "/backgroundpage.html", 1);
[email protected]7912e822014-04-16 02:37:0324 ASSERT_TRUE(host->host_contents()->GetDelegate()->IsNeverVisible(
25 host->host_contents()));
[email protected]fad73672012-06-15 23:26:0626}
Devlin Cronin836f545d2018-05-09 00:25:0527
28} // namespace extensions