| 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 traverse images in the slide mode. | 8 * Runs a test to traverse images in the slide mode. |
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 * @return {Promise} Promise to be fulfilled with on success. | 71 * @return {Promise} Promise to be fulfilled with on success. |
| 72 */ | 72 */ |
| 73 function deleteImage(testVolumeName, volumeType) { | 73 function deleteImage(testVolumeName, volumeType) { |
| 74 var launchedPromise = launch( | 74 var launchedPromise = launch( |
| 75 testVolumeName, volumeType, [ENTRIES.desktop]); | 75 testVolumeName, volumeType, [ENTRIES.desktop]); |
| 76 var appId; | 76 var appId; |
| 77 return launchedPromise.then(function(args) { | 77 return launchedPromise.then(function(args) { |
| 78 appId = args.appId; | 78 appId = args.appId; |
| 79 return gallery.waitForSlideImage(appId, 800, 600, 'My Desktop Background'); | 79 return gallery.waitForSlideImage(appId, 800, 600, 'My Desktop Background'); |
| 80 }).then(function() { | 80 }).then(function() { |
| 81 return gallery.waitAndClickElement(appId, '.button.delete'); | 81 return gallery.waitAndClickElement(appId, 'paper-button.delete'); |
| 82 }).then(function() { | 82 }).then(function() { |
| 83 return gallery.waitAndClickElement(appId, '.cr-dialog-ok'); | 83 return gallery.waitAndClickElement(appId, '.cr-dialog-ok'); |
| 84 }).then(function() { | 84 }).then(function() { |
| 85 return repeatUntil(function() { | 85 return repeatUntil(function() { |
| 86 return gallery.getFilesUnderVolume(volumeType, ['New Image Name.png']) | 86 return gallery.getFilesUnderVolume(volumeType, ['New Image Name.png']) |
| 87 .then(function(urls) { | 87 .then(function(urls) { |
| 88 if (urls.length == 0) | 88 if (urls.length == 0) |
| 89 return true; | 89 return true; |
| 90 return pending('"New Image Name.png" is still there.'); | 90 return pending('"New Image Name.png" is still there.'); |
| 91 }); | 91 }); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return deleteImage('local', 'downloads'); | 133 return deleteImage('local', 'downloads'); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * The deleteImage test for Google Drive. | 137 * The deleteImage test for Google Drive. |
| 138 * @return {Promise} Promise to be fulfilled with on success. | 138 * @return {Promise} Promise to be fulfilled with on success. |
| 139 */ | 139 */ |
| 140 testcase.deleteImageOnDrive = function() { | 140 testcase.deleteImageOnDrive = function() { |
| 141 return deleteImage('drive', 'drive'); | 141 return deleteImage('drive', 'drive'); |
| 142 }; | 142 }; |
| OLD | NEW |