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

Unified Diff: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp

Issue 1389093002: Make sure plugin element is focused in PluginDocument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « third_party/WebKit/Source/core/html/PluginDocument.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
index d42df5345541324848ec384263889fd9732f45a6..72cad6fb531b043ce985c4ce95aafd19a1a972fb 100644
--- a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
@@ -159,6 +159,22 @@ TEST_F(WebPluginContainerTest, WindowToLocalPointTest)
ASSERT_EQ(10, point4.y);
}
+TEST_F(WebPluginContainerTest, PluginDocumentPluginIsFocused)
+{
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf"));
+
+ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper.
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", true, &pluginWebFrameClient);
+ ASSERT(webView);
+ webView->layout();
+
+ WebDocument document = webView->mainFrame()->document();
+ EXPECT_TRUE(document.isPluginDocument());
+ WebPluginContainer* pluginContainer = getWebPluginContainer(webView, "plugin");
+ EXPECT_EQ(document.focusedElement(), pluginContainer->element());
+}
+
TEST_F(WebPluginContainerTest, PrintOnePage)
{
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf"));
« no previous file with comments | « third_party/WebKit/Source/core/html/PluginDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698