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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "domfocusou t_domfocusin_events.html", true, 0); 1220 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "domfocusou t_domfocusin_events.html", true, 0);
1221 1221
1222 webView->setFocus(true); 1222 webView->setFocus(true);
1223 webView->setFocus(false); 1223 webView->setFocus(false);
1224 webView->setFocus(true); 1224 webView->setFocus(true);
1225 1225
1226 WebElement element = webView->mainFrame()->document().getElementById("messag e"); 1226 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1227 EXPECT_STREQ("DOMFocusOutDOMFocusIn", element.innerText().utf8().data()); 1227 EXPECT_STREQ("DOMFocusOutDOMFocusIn", element.innerText().utf8().data());
1228 } 1228 }
1229 1229
1230 TEST_F(WebViewTest, DispatchesFocusBlurOnViewToggle)
1231 {
1232 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), "focus_blur_events.html");
1233 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "focus_blur _events.html", true, 0);
1234
1235 webView->setFocus(true);
1236 webView->setFocus(false);
1237 webView->setFocus(true);
1238
1239 WebElement element = webView->mainFrame()->document().getElementById("messag e");
1240 // Expect not to see duplication of events.
1241 EXPECT_STREQ("blurfocus", element.innerText().utf8().data());
1230 } 1242 }
1243
1244 }
OLDNEW
« 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