| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 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 * Tests if the files initially added by the C++ side are displayed, and | 8 * Tests if the files initially added by the C++ side are displayed, and |
| 9 * that a subsequently added file shows up. | 9 * that a subsequently added file shows up. |
| 10 * | 10 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ]); | 43 ]); |
| 44 } | 44 } |
| 45 | 45 |
| 46 testcase.fileDisplayDownloads = function() { | 46 testcase.fileDisplayDownloads = function() { |
| 47 fileDisplay(RootPath.DOWNLOADS); | 47 fileDisplay(RootPath.DOWNLOADS); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 testcase.fileDisplayDrive = function() { | 50 testcase.fileDisplayDrive = function() { |
| 51 fileDisplay(RootPath.DRIVE); | 51 fileDisplay(RootPath.DRIVE); |
| 52 }; | 52 }; |
| 53 |
| 54 testcase.fileDisplayMtp = function() { |
| 55 var appId; |
| 56 var MTP_VOLUME_QUERY = '#navigation-list > .root-item > ' + |
| 57 '.volume-icon[volume-type-icon="mtp"]'; |
| 58 |
| 59 StepsRunner.run([ |
| 60 function() { |
| 61 setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next); |
| 62 }, |
| 63 // Mount a fake MTP volume. |
| 64 function(inAppId, files) { |
| 65 appId = inAppId; |
| 66 chrome.test.sendMessage(JSON.stringify({name: 'mountFakeMtp'}), |
| 67 this.next); |
| 68 }, |
| 69 // Wait for the mount. |
| 70 function(result) { |
| 71 waitForElement(appId, MTP_VOLUME_QUERY).then(this.next); |
| 72 }, |
| 73 // Click the MTP volume. |
| 74 function() { |
| 75 callRemoteTestUtil( |
| 76 'fakeMouseClick', appId, [MTP_VOLUME_QUERY], this.next); |
| 77 }, |
| 78 // Wait for the file list to change. |
| 79 function(appIds) { |
| 80 waitForFiles(appId, TestEntryInfo.getExpectedRows(BASIC_FAKE_ENTRY_SET), |
| 81 {ignoreLastModifiedTime: true}).then(this.next); |
| 82 }, |
| 83 function() { |
| 84 checkIfNoErrorsOccured(this.next); |
| 85 } |
| 86 ]); |
| 87 }; |
| OLD | NEW |