OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 'use strict'; | |
6 | |
7 /** | |
8 * Tests the focus behavior of the search box. | |
9 */ | |
10 testcase.searchBoxFocus = function() { | |
11 var appId; | |
12 StepsRunner.run([ | |
13 // Set up File Manager. | |
14 function() { | |
15 setupAndWaitUntilReady(null, RootPath.DRIVE, this.next); | |
16 }, | |
17 // Check that the file list has the focus on launch. | |
18 function(inAppId) { | |
19 appId = inAppId; | |
20 waitForElement(appId, ['#file-list:focus']).then(this.next); | |
21 }, | |
22 // Press the Ctrl-F key. | |
23 function(element) { | |
24 callRemoteTestUtil('fakeKeyDown', | |
25 appId, | |
26 ['body', 'U+0046', true], | |
27 this.next); | |
28 }, | |
29 // Check that the search box has the focus. | |
30 function(result) { | |
31 chrome.test.assertTrue(result); | |
32 waitForElement(appId, ['#search-box input:focus']).then(this.next); | |
33 }, | |
34 // Press the Tab key. | |
35 function(element) { | |
36 callRemoteTestUtil('fakeKeyDown', | |
37 appId, | |
38 ['body', 'U+0009', false], | |
39 this.next); | |
40 }, | |
41 // Check that the file list has the focus. | |
42 function(result) { | |
43 chrome.test.assertTrue(result); | |
44 waitForElement(appId, ['#file-list:focus']).then(this.next); | |
45 }, | |
46 // Check for errors. | |
47 function(element) { | |
48 checkIfNoErrorsOccured(this.next); | |
49 } | |
50 ]); | |
51 }; | |
OLD | NEW |