| 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 |
| 11 * function. Either 'drive' or 'local'. | 11 * function. Either 'drive' or 'local'. |
| 12 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. | 12 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. |
| 13 * @return {Promise} Promise to be fulfilled with on success. | 13 * @return {Promise} Promise to be fulfilled with on success. |
| 14 */ | 14 */ |
| 15 function openSingleImage(testVolumeName, volumeType) { | 15 function openSingleImage(testVolumeName, volumeType) { |
| 16 var launchedPromise = launch(testVolumeName, volumeType, [ENTRIES.desktop]); | 16 var launchedPromise = launch(testVolumeName, volumeType, [ENTRIES.desktop]); |
| 17 return launchedPromise.then(function(args) { | 17 return launchedPromise.then(function(args) { |
| 18 var WIDTH = 880; | 18 var WIDTH = 880; |
| 19 var HEIGHT = 603; /* Inner height 570px + native header 33px. */ | 19 var HEIGHT = 570; |
| 20 var appId = args.appId; | 20 var appId = args.appId; |
| 21 var resizedWindowPromise = gallery.callRemoteTestUtil( | 21 var resizedWindowPromise = gallery.callRemoteTestUtil( |
| 22 'resizeWindow', appId, [WIDTH, HEIGHT] | 22 'resizeWindow', appId, [WIDTH, HEIGHT] |
| 23 ).then(function() { | 23 ).then(function() { |
| 24 return repeatUntil(function() { | 24 return repeatUntil(function() { |
| 25 return gallery.callRemoteTestUtil('getWindows', null, [] | 25 return gallery.callRemoteTestUtil('getWindows', null, [] |
| 26 ).then(function(windows) { | 26 ).then(function(windows) { |
| 27 var bounds = windows[appId]; | 27 var bounds = windows[appId]; |
| 28 if (!bounds) | 28 if (!bounds) |
| 29 return pending('Window is not ready yet.'); | 29 return pending('Window is not ready yet.'); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |