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

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 26149002: Don't dispatch blur/focus events if the element's page is not focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert to original approach, update test. Created 7 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 | « Source/core/dom/Document.cpp ('k') | Source/web/tests/data/focus_blur_events.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index 5e6169a87cc858d442d3f49ae791a1d2665ebcb5..f300d0f3f64726f2943e68da8a1fa7f6f2c71db8 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -1227,4 +1227,18 @@ TEST_F(WebViewTest, DispatchesDomFocusOutDomFocusInOnViewToggleFocus)
EXPECT_STREQ("DOMFocusOutDOMFocusIn", element.innerText().utf8().data());
}
+TEST_F(WebViewTest, DispatchesFocusBlurOnViewToggle)
+{
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), "focus_blur_events.html");
+ WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "focus_blur_events.html", true, 0);
+
+ webView->setFocus(true);
+ webView->setFocus(false);
+ webView->setFocus(true);
+
+ WebElement element = webView->mainFrame()->document().getElementById("message");
+ // Expect not to see duplication of events.
+ EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
+}
+
}
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/web/tests/data/focus_blur_events.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698