OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Constants for selectors. | 8 * Constants for selectors. |
9 */ | 9 */ |
10 var TREEITEM_DRIVE = '#directory-tree > div:nth-child(1) > .tree-children ' + | 10 var TREEITEM_DRIVE = '#directory-tree > div:nth-child(1) > .tree-children ' + |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 function() { | 292 function() { |
293 expectSelection( | 293 expectSelection( |
294 windowId, DIRECTORY.Drive, DIRECTORY.Drive).then(this.next); | 294 windowId, DIRECTORY.Drive, DIRECTORY.Drive).then(this.next); |
295 }, | 295 }, |
296 | 296 |
297 // Press Ctrl+4 to select 4th shortcut. | 297 // Press Ctrl+4 to select 4th shortcut. |
298 // Current directory should be D. | 298 // Current directory should be D. |
299 // Shortcut to C should be selected. | 299 // Shortcut to C should be selected. |
300 function() { | 300 function() { |
301 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, | 301 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, |
302 ['#file-list', 'U+0034', true, false, false], this.next); | 302 ['#file-list', '4', 'U+0034', true, false, false], this.next); |
303 }, | 303 }, |
304 function(result) { | 304 function(result) { |
305 chrome.test.assertTrue(result); | 305 chrome.test.assertTrue(result); |
306 expectSelection(windowId, DIRECTORY.D, DIRECTORY.D).then(this.next); | 306 expectSelection(windowId, DIRECTORY.D, DIRECTORY.D).then(this.next); |
307 }, | 307 }, |
308 | 308 |
309 // Press UP to select 3rd shortcut. | 309 // Press UP to select 3rd shortcut. |
310 // Current directory should remain D. | 310 // Current directory should remain D. |
311 // Shortcut to C should be selected. | 311 // Shortcut to C should be selected. |
312 function() { | 312 function() { |
313 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, | 313 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, |
314 ['#directory-tree', 'Up', false, false, false], this.next); | 314 ['#directory-tree', 'ArrowUp', 'Up', false, false, false], this.next); |
315 }, | 315 }, |
316 function(result) { | 316 function(result) { |
317 chrome.test.assertTrue(result); | 317 chrome.test.assertTrue(result); |
318 expectSelection(windowId, DIRECTORY.D, DIRECTORY.C).then(this.next); | 318 expectSelection(windowId, DIRECTORY.D, DIRECTORY.C).then(this.next); |
319 }, | 319 }, |
320 | 320 |
321 // Press Enter to change the directory to C. | 321 // Press Enter to change the directory to C. |
322 // Current directory should be C. | 322 // Current directory should be C. |
323 function() { | 323 function() { |
324 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, | 324 remoteCall.callRemoteTestUtil('fakeKeyDown', windowId, |
325 ['#directory-tree', 'Enter', false, false, false], this.next); | 325 ['#directory-tree', 'Enter', 'Enter', false, false, false], |
| 326 this.next); |
326 }, | 327 }, |
327 function(result) { | 328 function(result) { |
328 chrome.test.assertTrue(result); | 329 chrome.test.assertTrue(result); |
329 expectSelection(windowId, DIRECTORY.C, DIRECTORY.C).then(this.next); | 330 expectSelection(windowId, DIRECTORY.C, DIRECTORY.C).then(this.next); |
330 }, | 331 }, |
331 | 332 |
332 function() { | 333 function() { |
333 checkIfNoErrorsOccured(this.next); | 334 checkIfNoErrorsOccured(this.next); |
334 } | 335 } |
335 ]); | 336 ]); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 remoteCall.waitForElement(windowId1, TREEITEM_D + '[selected]'). | 406 remoteCall.waitForElement(windowId1, TREEITEM_D + '[selected]'). |
406 then(this.next); | 407 then(this.next); |
407 }, | 408 }, |
408 | 409 |
409 function() { | 410 function() { |
410 checkIfNoErrorsOccured(this.next); | 411 checkIfNoErrorsOccured(this.next); |
411 } | 412 } |
412 ]); | 413 ]); |
413 }; | 414 }; |
414 | 415 |
OLD | NEW |