Chromium Code Reviews| 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 88d6569e4a62ad9edb15f99bb682499e4821c5f0..04554e086f9b92f3f4fd6ede438bf8a18516043c 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, EmbedderVisibilityChanged) { |
|
Charlie Reis
2012/10/05 00:33:18
I think these names are backwards, right?
Fady Samuel
2012/10/05 15:22:07
Wow, you're right, I don't know how that happened
|
| 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, BrowserPluginVisibilityChanged) { |
| + const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
| + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
| // Hide the embedder. |
| test_embedder()->web_contents()->WasHidden(); |