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

Unified Diff: content/browser/browser_plugin/browser_plugin_host_browsertest.cc

Issue 11066032: Browser Plugin: Update Guest WebContents Visibility on BrowserPlugin Visiblity Change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 2 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
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_host_browsertest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index 0fcf028355701bb993cea1ff567cd83e2154d7e5..28ab5b1fa0f31994a83b17081990ecaad16f0529 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -416,12 +416,24 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) {
ASSERT_EQ(test_embedder_after_nav, test_embedder());
}
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityChanged) {
+// This test verifies that hiding the embedder also hides the guest.
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) {
const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
- // Wait for the guest to send an UpdateRectMsg, meaning it is ready.
- test_guest()->WaitForUpdateRectMsg();
+ // Hide the Browser Plugin.
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
+ test_embedder()->web_contents()->GetRenderViewHost());
+ rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16(
+ "document.getElementById('plugin').style.visibility = 'hidden'"));
+
+ // Make sure that the guest is hidden.
+ test_guest()->WaitUntilHidden();
+}
+
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) {
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, "");
// Hide the embedder.
test_embedder()->web_contents()->WasHidden();
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698