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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html

Issue 1437813002: Set selection to INPUT/TEXTAREA before dispatching 'focus' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve selection-functions.html Created 5 years, 1 month 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: third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html b/third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html
index 1313f133a6dac15fd1a7b949c882f387a571833a..4cafb338530c6ab7a677cf8ae7faed8ee198fef0 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html
@@ -15,9 +15,12 @@ function changeToPasswordField(textField)
function test()
{
- if (window.testRunner) {
- var field = document.getElementById("field").focus();
-
+ if (!window.testRunner)
+ return;
+ var field = document.getElementById("field").focus();
+ // Need short delay because changing input type doesn't set selection in the
+ // input element immediately becasue layout is dirty.
+ setTimeout(function() {
eventSender.keyDown("p");
eventSender.keyDown("a");
eventSender.keyDown("s");
@@ -27,7 +30,7 @@ function test()
isSuccessfullyParsed();
window.testRunner.notifyDone();
- }
+ }, 0);
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698