| 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 * Runs a test to open a single image. | 8 * Runs a test to open a single image. |
| 9 * | 9 * |
| 10 * @param {string} testVolumeName Test volume name passed to the addEntries | 10 * @param {string} testVolumeName Test volume name passed to the addEntries |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 */ | 107 */ |
| 108 function openMultipleImagesAndChangeToSlideMode(testVolumeName, volumeType) { | 108 function openMultipleImagesAndChangeToSlideMode(testVolumeName, volumeType) { |
| 109 var testEntries = [ENTRIES.desktop, ENTRIES.image3]; | 109 var testEntries = [ENTRIES.desktop, ENTRIES.image3]; |
| 110 var launchedPromise = launch(testVolumeName, volumeType, testEntries); | 110 var launchedPromise = launch(testVolumeName, volumeType, testEntries); |
| 111 return launchedPromise.then(function(args) { | 111 return launchedPromise.then(function(args) { |
| 112 var appId = args.appId; | 112 var appId = args.appId; |
| 113 return confirmTwoImagesAreLoadedInThumbnailMode(appId).then(function() { | 113 return confirmTwoImagesAreLoadedInThumbnailMode(appId).then(function() { |
| 114 // Press Enter key and mode should be changed to slide mode. | 114 // Press Enter key and mode should be changed to slide mode. |
| 115 return gallery.callRemoteTestUtil( | 115 return gallery.callRemoteTestUtil( |
| 116 'fakeKeyDown', appId, | 116 'fakeKeyDown', appId, |
| 117 [null /* active element */, 'Enter', false, false, false]); | 117 [null /* active element */, 'Enter', 'Enter', false, false, false]); |
| 118 }).then(function() { | 118 }).then(function() { |
| 119 // Wait until it changes to slide mode. | 119 // Wait until it changes to slide mode. |
| 120 return gallery.waitForElement(appId, '.gallery[mode="slide"]'); | 120 return gallery.waitForElement(appId, '.gallery[mode="slide"]'); |
| 121 }); | 121 }); |
| 122 }); | 122 }); |
| 123 } | 123 } |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * The openSingleImage test for Downloads. | 126 * The openSingleImage test for Downloads. |
| 127 * @return {Promise} Promise to be fulfilled with on success. | 127 * @return {Promise} Promise to be fulfilled with on success. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 154 return openMultipleImages('drive', 'drive'); | 154 return openMultipleImages('drive', 'drive'); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 /** | 157 /** |
| 158 * The openMultipleImagesAndChangeToSlideMode test for Downloads. | 158 * The openMultipleImagesAndChangeToSlideMode test for Downloads. |
| 159 * @return {Promise} Promise to be fulfilled with on success. | 159 * @return {Promise} Promise to be fulfilled with on success. |
| 160 */ | 160 */ |
| 161 testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() { | 161 testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() { |
| 162 return openMultipleImagesAndChangeToSlideMode('local', 'downloads'); | 162 return openMultipleImagesAndChangeToSlideMode('local', 'downloads'); |
| 163 }; | 163 }; |
| OLD | NEW |