Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2327)

Unified Diff: content/browser/web_contents/web_contents_view_aura_browsertest.cc

Issue 286943005: Reducing CPU cycles of hidden/minimized browser windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_aura_browsertest.cc
diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
index 330f624685b00f9f3ec4a9546c72edd1784e7983..ca2362f051deb2984da0e82ef92f7ecae6053aa3 100644
--- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc
+++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
@@ -594,8 +594,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
window->AddChild(shell()->web_contents()->GetContentNativeView());
}
-IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
- ContentWindowClose) {
+IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, ContentWindowClose) {
ASSERT_NO_FATAL_FAILURE(
StartTestWithPage("files/overscroll_navigation.html"));
@@ -684,4 +683,18 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
EXPECT_FALSE(controller.CanGoForward());
}
+// Verify that hiding a parent of the renderer will hide the content too.
+IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, HideContentOnParenHide) {
+ ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/title1.html"));
+ WebContentsImpl* web_contents =
+ static_cast<WebContentsImpl*>(shell()->web_contents());
+ aura::Window* content = web_contents->GetContentNativeView();
sky 2014/05/20 23:33:51 I'm surprised this works. web_contents->GetContent
Mr4D (OOO till 08-26) 2014/05/21 14:25:03 I am not using this window - I am using it's paren
+ aura::Window* parent = content->parent();
+ EXPECT_TRUE(web_contents->should_normally_be_visible());
+ parent->Hide();
ncarter (slow) 2014/05/20 21:42:26 Does this actually minimize the parent? Wasn't the
Mr4D (OOO till 08-26) 2014/05/20 21:48:56 Well - If I understand sky's request correctly, we
sky 2014/05/20 23:33:51 Exactly.
+ EXPECT_FALSE(web_contents->should_normally_be_visible());
+ parent->Show();
+ EXPECT_TRUE(web_contents->should_normally_be_visible());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698