OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Expected files before tests are performed. | 6 * Expected files before tests are performed. |
7 * @type {Array.<Array.<string>>} | 7 * @type {Array.<Array.<string>>} |
8 * @const | 8 * @const |
9 */ | 9 */ |
10 var EXPECTED_FILES_BEFORE = [ | 10 var EXPECTED_FILES_BEFORE = [ |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 'fakeMouseClick', appId, ['[volume-type-icon=drive_recent]'], | 166 'fakeMouseClick', appId, ['[volume-type-icon=drive_recent]'], |
167 function(result) { | 167 function(result) { |
168 chrome.test.assertFalse(!result); | 168 chrome.test.assertFalse(!result); |
169 callRemoteTestUtil('waitForFileListChange', | 169 callRemoteTestUtil('waitForFileListChange', |
170 appId, | 170 appId, |
171 [EXPECTED_FILES_BEFORE.length], | 171 [EXPECTED_FILES_BEFORE.length], |
172 onFileListChange); | 172 onFileListChange); |
173 }); | 173 }); |
174 }); | 174 }); |
175 }; | 175 }; |
| 176 |
| 177 /** |
| 178 * Tests autocomplete with a query 'hello'. This test is only available for |
| 179 * Drive. |
| 180 */ |
| 181 testcase.autocomplete = function() { |
| 182 var EXPECTED_AUTOCOMPLETE_LIST = [ |
| 183 '\'hello\' - search Drive\n', |
| 184 'hello.txt\n', |
| 185 ]; |
| 186 |
| 187 var onAutocompleteListShown = chrome.test.callbackPass( |
| 188 function(autocompleteList) { |
| 189 chrome.test.assertEq(EXPECTED_AUTOCOMPLETE_LIST, autocompleteList); |
| 190 }); |
| 191 |
| 192 setupAndWaitUntilReady('/drive/root', function(appId, list) { |
| 193 callRemoteTestUtil('performAutocompleteAndWait', |
| 194 appId, |
| 195 ['hello', EXPECTED_AUTOCOMPLETE_LIST.length], |
| 196 onAutocompleteListShown); |
| 197 }); |
| 198 }; |
OLD | NEW |