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

Unified Diff: chrome/test/data/instant_extended.html

Issue 12114050: [Instant] Instant Extended tests for search term extraction. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixes Created 7 years, 10 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
Index: chrome/test/data/instant_extended.html
diff --git a/chrome/test/data/instant_extended.html b/chrome/test/data/instant_extended.html
index f6f59026b23c339cd253e465dff8a945d1f78678..0a620c7b46e8a062085a762e1f8298db78552211 100644
--- a/chrome/test/data/instant_extended.html
+++ b/chrome/test/data/instant_extended.html
@@ -5,6 +5,7 @@
var apiHandle;
var onnativesuggestioncalls = 0;
var onsubmitcalls = 0;
+var suggestion;
function getApiHandle() {
if (window.navigator && window.navigator.searchBox)
@@ -16,15 +17,25 @@ function getApiHandle() {
function handleNativeSuggestions() {
onnativesuggestioncalls++;
- apiHandle.show(2 /* QUERY_SUGGESTIONS */, 300);
+ // Showing the loader at 100% height.
+ apiHandle.show(2 /* QUERY_SUGGESTIONS */);
}
function handleSubmit() {
onsubmitcalls++;
}
+function handleOnChange() {
+ if (suggestion) {
+ apiHandle.setAutocompleteText(suggestion, 2);
+ // Ensure this is only called once for this suggestion.
+ suggestion = null;
+ }
+}
+
function setUp() {
apiHandle = getApiHandle();
+ apiHandle.onchange = handleOnChange;
apiHandle.onnativesuggestions = handleNativeSuggestions;
apiHandle.onsubmit = handleSubmit;
if (apiHandle.value)
« chrome/browser/instant/instant_test_utils.h ('K') | « chrome/browser/instant/instant_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698