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

Side by Side Diff: chrome/test/data/instant_extended.html

Issue 13141002: Use Instant suggested match type for Instant temporary text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/search/instant_extended_interactive_uitest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 4
5 var apiHandle; 5 var apiHandle;
6 var newTabPageHandle; 6 var newTabPageHandle;
7 var savedUserText = null; 7 var savedUserText = null;
8 var suggestionIndex = -1; 8 var suggestionIndex = -1;
9 var suggestions = ["result 1", "result 2", "http://www.google.com"]; 9 var suggestions = ["result 1", "result 2", "http://www.google.com"];
10 var suggestion; 10 var suggestion;
11 var behavior = 2; 11 var suggestionType = 0; // INSTANT_SUGGESTION_SEARCH
12 var behavior = 2; // INSTANT_COMPLETE_NEVER
12 var onMostVisitedChangedCalls = 0; 13 var onMostVisitedChangedCalls = 0;
13 var mostVisitedItemsCount = 0; 14 var mostVisitedItemsCount = 0;
14 var firstMostVisitedItemId = 0; 15 var firstMostVisitedItemId = 0;
15 var onNativeSuggestionsCalls = 0; 16 var onNativeSuggestionsCalls = 0;
16 var onChangeCalls = 0; 17 var onChangeCalls = 0;
17 var submitCount = 0; 18 var submitCount = 0;
18 19
19 function getApiHandle() { 20 function getApiHandle() {
20 if (window.navigator && window.navigator.searchBox) 21 if (window.navigator && window.navigator.searchBox)
21 return window.navigator.searchBox; 22 return window.navigator.searchBox;
(...skipping 27 matching lines...) Expand all
49 function handleOnChange() { 50 function handleOnChange() {
50 onChangeCalls++; 51 onChangeCalls++;
51 savedUserText = apiHandle.value; 52 savedUserText = apiHandle.value;
52 suggestionIndex = -1; 53 suggestionIndex = -1;
53 apiHandle.setAutocompleteText(suggestion, behavior); 54 apiHandle.setAutocompleteText(suggestion, behavior);
54 } 55 }
55 56
56 function nextSuggestion() { 57 function nextSuggestion() {
57 if (suggestionIndex < suggestions.length - 1) { 58 if (suggestionIndex < suggestions.length - 1) {
58 suggestionIndex++; 59 suggestionIndex++;
59 apiHandle.setValue(suggestions[suggestionIndex]); 60 apiHandle.setValue(suggestions[suggestionIndex], suggestionType);
60 } 61 }
61 } 62 }
62 63
63 function previousSuggestion() { 64 function previousSuggestion() {
64 if (suggestionIndex != -1) { 65 if (suggestionIndex != -1) {
65 suggestionIndex--; 66 suggestionIndex--;
66 if (suggestionIndex == -1) { 67 if (suggestionIndex == -1) {
67 apiHandle.setValue(savedUserText); 68 apiHandle.setValue(savedUserText, suggestionType);
68 } else { 69 } else {
69 apiHandle.setValue(suggestions[suggestionIndex]); 70 apiHandle.setValue(suggestions[suggestionIndex], suggestionType);
70 } 71 }
71 } 72 }
72 } 73 }
73 74
74 function handleKeyPress(event) { 75 function handleKeyPress(event) {
75 var VKEY_ESCAPE = 0x1B; 76 var VKEY_ESCAPE = 0x1B;
76 var VKEY_UP = 0x26; 77 var VKEY_UP = 0x26;
77 var VKEY_DOWN = 0x28; 78 var VKEY_DOWN = 0x28;
78 79
79 if (event.keyCode == VKEY_ESCAPE) { 80 if (event.keyCode == VKEY_ESCAPE) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 119 }
119 120
120 setUp(); 121 setUp();
121 122
122 </script> 123 </script>
123 </head> 124 </head>
124 <body> 125 <body>
125 <h1>Instant</h1> 126 <h1>Instant</h1>
126 </body> 127 </body>
127 </html> 128 </html>
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_extended_interactive_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698