| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Runs a test to open multiple images. | 62 * Runs a test to open multiple images. |
| 63 * | 63 * |
| 64 * @param {string} testVolumeName Test volume name passed to the addEntries | 64 * @param {string} testVolumeName Test volume name passed to the addEntries |
| 65 * function. Either 'drive' or 'local'. | 65 * function. Either 'drive' or 'local'. |
| 66 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. | 66 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. |
| 67 * @return {Promise} Promise to be fulfilled with on success. | 67 * @return {Promise} Promise to be fulfilled with on success. |
| 68 */ | 68 */ |
| 69 function openMultipleImages(testVolumeName, volumeType) { | 69 function openMultipleImages(testVolumeName, volumeType) { |
| 70 var testEntries = [ENTRIES.desktop, ENTRIES.image2, ENTRIES.image3]; | 70 var testEntries = [ENTRIES.desktop, ENTRIES.image3]; |
| 71 var launchedPromise = launch(testVolumeName, volumeType, testEntries); | 71 var launchedPromise = launch(testVolumeName, volumeType, testEntries); |
| 72 return launchedPromise.then(function(args) { | 72 return launchedPromise.then(function(args) { |
| 73 var appId = args.appId; | 73 var appId = args.appId; |
| 74 var rootElementPromise = | 74 var rootElementPromise = |
| 75 gallery.waitForElement(appId, '.gallery[mode="mosaic"]'); | 75 gallery.waitForElement(appId, '.gallery[mode="mosaic"]'); |
| 76 var tilesPromise = repeatUntil(function() { | 76 var tilesPromise = repeatUntil(function() { |
| 77 return gallery.callRemoteTestUtil( | 77 return gallery.callRemoteTestUtil( |
| 78 'queryAllElements', | 78 'queryAllElements', |
| 79 appId, | 79 appId, |
| 80 ['.mosaic-tile'] | 80 ['.mosaic-tile'] |
| 81 ).then(function(tiles) { | 81 ).then(function(tiles) { |
| 82 if (tiles.length !== 3) | 82 if (tiles.length !== 2) |
| 83 return pending('The number of tiles is expected 3, but is %d', | 83 return pending('The number of tiles is expected 2, but is %d', |
| 84 tiles.length); | 84 tiles.length); |
| 85 return tiles; | 85 return tiles; |
| 86 }); | 86 }); |
| 87 }); | 87 }); |
| 88 return Promise.all([rootElementPromise, tilesPromise]); | 88 return Promise.all([rootElementPromise, tilesPromise]); |
| 89 }); | 89 }); |
| 90 } | 90 } |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * The openSingleImage test for Downloads. | 93 * The openSingleImage test for Downloads. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 113 return openMultipleImages('local', 'downloads'); | 113 return openMultipleImages('local', 'downloads'); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * The openMultiImages test for Google Drive. | 117 * The openMultiImages test for Google Drive. |
| 118 * @return {Promise} Promise to be fulfilled with on success. | 118 * @return {Promise} Promise to be fulfilled with on success. |
| 119 */ | 119 */ |
| 120 testcase.openMultipleImagesOnDrive = function() { | 120 testcase.openMultipleImagesOnDrive = function() { |
| 121 return openMultipleImages('drive', 'drive'); | 121 return openMultipleImages('drive', 'drive'); |
| 122 }; | 122 }; |
| OLD | NEW |