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

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

Issue 10836031: Remove Instant v1 API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update history, title, favicon Created 8 years, 4 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/renderer/searchbox_extension.cc ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | 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><body><h1>Instant</h1><script>
2 <body>
3 <h1>Instant</h1>
4 <script>
5 window.chrome.sv = true;
6 2
7 window.onsubmitcalls = 0; 3 var onchangecalls = 0;
8 window.onchangecalls = 0; 4 var onsubmitcalls = 0;
9 window.oncancelcalls = 0; 5 var oncancelcalls = 0;
10 window.onresizecalls = 0; 6 var onresizecalls = 0;
11 7
12 Object.prototype.clone = function() { 8 var value = "";
13 var copy = {}; 9 var verbatim = false;
14 for (var prop in this) copy[prop] = this[prop]; 10 var height = 0;
15 return copy; 11
12 var suggestion = [ { value: "query suggestion" } ];
13 var behavior = "now";
14
15 chrome.searchBox.onchange = function() {
16 onchangecalls++;
17 value = chrome.searchBox.value;
18 verbatim = chrome.searchBox.verbatim;
19 chrome.searchBox.setSuggestions({
20 suggestions: suggestion,
21 complete_behavior: behavior
22 });
16 }; 23 };
17 24
18 window.beforeLoadSearchBox = window.chrome.searchBox.clone(); 25 chrome.searchBox.onsubmit = function() {
19 window.lastSearchBox = window.chrome.searchBox.clone(); 26 onsubmitcalls++;
20 27 value = chrome.searchBox.value;
21 window.setSuggestionsArgument = { 28 verbatim = chrome.searchBox.verbatim;
22 suggestions: [
23 { value: "defghi" }
24 ]
25 }; 29 };
26 30
27 window.chrome.searchBox.onsubmit = function() { 31 chrome.searchBox.oncancel = function() {
28 window.chrome.searchBox.setSuggestions(setSuggestionsArgument); 32 oncancelcalls++;
29 window.lastSearchBox = window.chrome.searchBox.clone(); 33 value = chrome.searchBox.value;
30 window.onsubmitcalls++; 34 verbatim = chrome.searchBox.verbatim;
31 }; 35 };
32 36
33 window.chrome.searchBox.onchange = function() { 37 chrome.searchBox.onresize = function() {
34 window.chrome.searchBox.setSuggestions(setSuggestionsArgument); 38 onresizecalls++;
35 window.lastSearchBox = window.chrome.searchBox.clone(); 39 height = chrome.searchBox.height;
36 window.onchangecalls++;
37 }; 40 };
38 41
39 window.chrome.searchBox.oncancel = function() { 42 if (chrome.searchBox.value != "")
40 window.chrome.searchBox.setSuggestions(setSuggestionsArgument); 43 chrome.searchBox.onchange();
41 window.lastSearchBox = window.chrome.searchBox.clone();
42 window.oncancelcalls++;
43 };
44 44
45 window.chrome.searchBox.onresize = function() { 45 </script></body></html>
46 window.onresizecalls++;
47 };
48 </script>
49 </body>
50 </html>
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox_extension.cc ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698