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 * Gets file entries just under the volume. | 8 * Gets file entries just under the volume. |
9 * | 9 * |
10 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. | 10 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 */ | 112 */ |
113 function launchWithTestEntries( | 113 function launchWithTestEntries( |
114 testVolumeName, volumeType, entries, opt_selected) { | 114 testVolumeName, volumeType, entries, opt_selected) { |
115 var entriesPromise = addEntries([testVolumeName], entries).then(function() { | 115 var entriesPromise = addEntries([testVolumeName], entries).then(function() { |
116 var selectedEntries = opt_selected || entries; | 116 var selectedEntries = opt_selected || entries; |
117 return getFilesUnderVolume( | 117 return getFilesUnderVolume( |
118 volumeType, | 118 volumeType, |
119 selectedEntries.map(function(entry) { return entry.nameText; })); | 119 selectedEntries.map(function(entry) { return entry.nameText; })); |
120 }); | 120 }); |
121 | 121 |
122 return launch(entriesPromise).then(function() { | 122 return entriesPromise.then(function(entries) { |
123 var launchedPromise = Promise.all([appWindowPromise, entriesPromise]); | 123 return window.initializePromise.then(function() { |
124 return launchedPromise.then(function(results) { | 124 var urls = util.entriesToURLs(entries); |
125 return {appWindow: results[0], entries: results[1]}; | 125 var launchedPromise = openGalleryWindow(urls, false); |
| 126 return launchedPromise.then(function(appWindow) { |
| 127 return {appWindow: appWindow, entries: entries}; |
| 128 }); |
126 }); | 129 }); |
127 }); | 130 }); |
128 } | 131 } |
129 | 132 |
130 /** | 133 /** |
131 * Waits until the expected image is shown. | 134 * Waits until the expected image is shown. |
132 * | 135 * |
133 * @param {document} document Document. | 136 * @param {document} document Document. |
134 * @param {number} width Expected width of the image. | 137 * @param {number} width Expected width of the image. |
135 * @param {number} height Expected height of the image. | 138 * @param {number} height Expected height of the image. |
(...skipping 11 matching lines...) Expand all Loading... |
147 height: fullResCanvas && fullResCanvas.height, | 150 height: fullResCanvas && fullResCanvas.height, |
148 name: nameBox && nameBox.value | 151 name: nameBox && nameBox.value |
149 }; | 152 }; |
150 if (!chrome.test.checkDeepEq(expected, actual)) { | 153 if (!chrome.test.checkDeepEq(expected, actual)) { |
151 return pending('Slide mode state, expected is %j, actual is %j.', | 154 return pending('Slide mode state, expected is %j, actual is %j.', |
152 expected, actual); | 155 expected, actual); |
153 } | 156 } |
154 return actual; | 157 return actual; |
155 }); | 158 }); |
156 } | 159 } |
OLD | NEW |