OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | 1049 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
1050 const std::string embedder_code = | 1050 const std::string embedder_code = |
1051 "document.getElementById('plugin').style.visibility = 'hidden'"; | 1051 "document.getElementById('plugin').style.visibility = 'hidden'"; |
1052 StartBrowserPluginTest( | 1052 StartBrowserPluginTest( |
1053 kEmbedderURL, kHTMLForGuest, true, embedder_code); | 1053 kEmbedderURL, kHTMLForGuest, true, embedder_code); |
1054 EXPECT_FALSE(test_guest()->visible()); | 1054 EXPECT_FALSE(test_guest()->visible()); |
1055 } | 1055 } |
1056 | 1056 |
1057 // This test verifies that if we lose the guest, and get a new one, | 1057 // This test verifies that if we lose the guest, and get a new one, |
1058 // the new guest will inherit the visibility state of the old guest. | 1058 // the new guest will inherit the visibility state of the old guest. |
1059 // | 1059 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityPreservation) { |
1060 // Very flaky on Linux, Linux CrOS, somewhat flaky on XP, slightly on | |
1061 // Mac; http://crbug.com/162809. | |
1062 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_VisibilityPreservation) { | |
1063 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | 1060 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
1064 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); | 1061 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
1065 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 1062 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
1066 test_embedder()->web_contents()->GetRenderViewHost()); | 1063 test_embedder()->web_contents()->GetRenderViewHost()); |
1067 // Hide the BrowserPlugin. | 1064 // Hide the BrowserPlugin. |
1068 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( | 1065 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( |
1069 "document.getElementById('plugin').style.visibility = 'hidden';")); | 1066 "document.getElementById('plugin').style.visibility = 'hidden';")); |
1070 test_guest()->WaitUntilHidden(); | 1067 test_guest()->WaitUntilHidden(); |
1071 // Kill the current guest. | 1068 // Kill the current guest. |
1072 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( | 1069 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 embedder_code); | 1234 embedder_code); |
1238 // Check for render view host at position (150, 150) that is outside the | 1235 // Check for render view host at position (150, 150) that is outside the |
1239 // bounds of our guest, so this would respond with the render view host of the | 1236 // bounds of our guest, so this would respond with the render view host of the |
1240 // embedder. | 1237 // embedder. |
1241 test_embedder()->WaitForRenderViewHostAtPosition(150, 150); | 1238 test_embedder()->WaitForRenderViewHostAtPosition(150, 150); |
1242 ASSERT_EQ(test_embedder()->web_contents()->GetRenderViewHost(), | 1239 ASSERT_EQ(test_embedder()->web_contents()->GetRenderViewHost(), |
1243 test_embedder()->last_rvh_at_position_response()); | 1240 test_embedder()->last_rvh_at_position_response()); |
1244 } | 1241 } |
1245 | 1242 |
1246 } // namespace content | 1243 } // namespace content |
OLD | NEW |