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

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

Issue 281833003: BrowserPluginHostTest: Rewrite 3 focus related tests and 1 visibility test to browser_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase @tott, fix conflict 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/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 e2a7a7c27a82b2d00238b7804a4fd1756983f1a4..2e3c4c89d41240ad59a03aac381be7c4e23d4fb2 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -230,28 +230,6 @@ class BrowserPluginHostTest : public ContentBrowserTest {
DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostTest);
};
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) {
- const char kEmbedderURL[] = "/browser_plugin_focus.html";
- const char* kGuestURL = "/browser_plugin_focus_child.html";
- StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
-
- SimulateMouseClick(test_embedder()->web_contents(), 0,
- blink::WebMouseEvent::ButtonLeft);
- BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents());
- // Wait until we focus into the guest.
- test_guest()->WaitForFocus();
-
- // TODO(fsamuel): A third Tab key press should not be necessary.
- // The browser plugin will take keyboard focus but it will not
- // focus an initial element. The initial element is dependent
- // upon tab direction which WebKit does not propagate to the plugin.
- // See http://crbug.com/147644.
- BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents());
- BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents());
- BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents());
- test_guest()->WaitForAdvanceFocus();
-}
-
// This test opens a page in http and then opens another page in https, forcing
// a RenderViewHost swap in the web_contents. We verify that the embedder in the
// web_contents gets cleared properly.
@@ -423,49 +401,6 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) {
EXPECT_EQ(expected_title, actual_title);
}
-// This test verifies that if a browser plugin is hidden before navigation,
-// the guest starts off hidden.
-// This test is flaky under ThreadSanitizer, see http://crbug.com/370240
-#if !defined(THREAD_SANITIZER)
-#define MAYBE_HiddenBeforeNavigation HiddenBeforeNavigation
-#else
-#define MAYBE_HiddenBeforeNavigation DISABLED_HiddenBeforeNavigation
-#endif
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_HiddenBeforeNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- const std::string embedder_code =
- "document.getElementById('plugin').style.visibility = 'hidden'";
- StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuest, true, embedder_code);
- EXPECT_FALSE(test_guest()->visible());
-}
-
-// This test verifies that if a browser plugin is focused before navigation then
-// the guest starts off focused.
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusBeforeNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- const std::string embedder_code =
- "document.getElementById('plugin').focus();";
- StartBrowserPluginTest(
- kEmbedderURL, kHTMLForGuest, true, embedder_code);
- RenderFrameHost* guest_rfh = test_guest()->web_contents()->GetMainFrame();
- // Verify that the guest is focused.
- scoped_ptr<base::Value> value =
- content::ExecuteScriptAndGetValue(guest_rfh, "document.hasFocus()");
- bool result = false;
- ASSERT_TRUE(value->GetAsBoolean(&result));
- EXPECT_TRUE(result);
-}
-
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusTracksEmbedder) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
- // Blur the embedder.
- test_embedder()->web_contents()->GetRenderViewHost()->Blur();
- // Ensure that the guest is also blurred.
- test_guest()->WaitForBlur();
-}
-
// This test verifies that if IME is enabled in the embedder, it is also enabled
// in the guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VerifyInputMethodActive) {
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/browser_plugin/test_browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698