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

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..9f9ede0e5a64ff0160a00c9f11173c99c73715bc 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()->parent();
sky 2014/05/21 16:15:16 My confusion here is is that what you care about i
Mr4D (OOO till 08-26) 2014/05/21 21:25:25 Done.
+ aura::Window* parent = content->parent();
+ EXPECT_TRUE(web_contents->should_normally_be_visible());
+ parent->Hide();
+ 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