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

Unified Diff: LayoutTests/fast/forms/select/select-typeahead-with-spacekey.html

Issue 1058243002: Implement support to consider <space> key as part of typeAhead searching. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch with new implementation Created 5 years, 8 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 | « no previous file | LayoutTests/fast/forms/select/select-typeahead-with-spacekey-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/select/select-typeahead-with-spacekey.html
diff --git a/LayoutTests/fast/forms/select/select-typeahead-with-spacekey.html b/LayoutTests/fast/forms/select/select-typeahead-with-spacekey.html
new file mode 100644
index 0000000000000000000000000000000000000000..3fabb548186259e4ebee20fc63b9d664ed88d17e
--- /dev/null
+++ b/LayoutTests/fast/forms/select/select-typeahead-with-spacekey.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<select id="select">
+ <option>Canada</option>
+ <option>Spain</option>
+ <option>United Arab Emerites</option>
+ <option>United States</option>
+</select>
+<script>
+description('Two keystrokes are considered as part of one typehead session if time difference between them is less than 1 sec');
+
+window.jsTestIsAsync = true;
+
+function keyDown(key, modifiers)
+{
+ if (!window.eventSender)
+ return;
+ eventSender.keyDown(key, modifiers);
+}
+
+var popup = document.getElementById("select");
+
+function test1() {
+ debug('1. space key as part of search string.');
+ popup.focus();
+ popup.selectedIndex = 0;
+ keyDown('U');
+ keyDown('n');
+ keyDown('i');
+ keyDown('t');
+ keyDown('e');
+ keyDown('d');
+ keyDown(' ');
+ keyDown('S');
+ shouldBeFalse('internals.isSelectPopupVisible(popup)');
+ shouldBeEqualToString('popup.value', 'United States');
+ popup.blur();
+ setTimeout(test2, 1000);
+}
+
+function test2() {
+ debug('2. space key as part of search string with some delay.');
+ popup.focus();
+ popup.selectedIndex = 0
+ keyDown('U');
+ keyDown('n');
+ keyDown('i');
+ keyDown('t');
+ keyDown('e');
+ keyDown('d');
+ keyDown(' ');
+ setTimeout(function() {
+ keyDown('S');
+ shouldBeFalse('internals.isSelectPopupVisible(popup)');
+ shouldBeEqualToString('popup.value', 'Spain');
+ popup.blur();
+ setTimeout(test3, 1000);
+ }, 1000);
+}
+
+function test3() {
+ debug('3. space key to open popup menu.');
+ popup.focus();
+ popup.selectedIndex = 0
+ keyDown('U');
+ keyDown('n');
+ keyDown('i');
+ keyDown('t');
+ keyDown('e');
+ keyDown('d');
+ setTimeout(function() {
+ keyDown(' ');
+ shouldBeTrue('internals.isSelectPopupVisible(popup)');
+ shouldBeEqualToString('popup.value', 'United Arab Emerites');
+ popup.blur();
+ finishJSTest();
+ }, 1000);
+}
+
+test1();
+</script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/select-typeahead-with-spacekey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698