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 * Prepares the photo editor. | 8 * Prepares the photo editor. |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 var appId = args.appId; | 87 var appId = args.appId; |
88 return gallery.waitAndClickElement(appId, | 88 return gallery.waitAndClickElement(appId, |
89 '.gallery:not([locked]) button.crop'). | 89 '.gallery:not([locked]) button.crop'). |
90 then(function() { | 90 then(function() { |
91 return Promise.all([ | 91 return Promise.all([ |
92 gallery.waitForElement(appId, '.crop-overlay') | 92 gallery.waitForElement(appId, '.crop-overlay') |
93 ]); | 93 ]); |
94 }). | 94 }). |
95 then(function() { | 95 then(function() { |
96 return gallery.fakeKeyDown( | 96 return gallery.fakeKeyDown( |
97 appId, 'body', 'Enter', false, false, false); | 97 appId, 'body', 'Enter', 'Enter', false, false, false); |
98 }). | 98 }). |
99 then(function(ret) { | 99 then(function(ret) { |
100 chrome.test.assertTrue(ret); | 100 chrome.test.assertTrue(ret); |
101 return Promise.all([ | 101 return Promise.all([ |
102 gallery.waitForElementLost(appId, '.crop-overlay') | 102 gallery.waitForElementLost(appId, '.crop-overlay') |
103 ]); | 103 ]); |
104 }). | 104 }). |
105 then(function() { | 105 then(function() { |
106 return gallery.waitForSlideImage( | 106 return gallery.waitForSlideImage( |
107 appId, | 107 appId, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 'changeValue', appId, ['.brightness > paper-slider', 20]); | 152 'changeValue', appId, ['.brightness > paper-slider', 20]); |
153 }).then(function() { | 153 }).then(function() { |
154 return gallery.callRemoteTestUtil( | 154 return gallery.callRemoteTestUtil( |
155 'changeValue', appId, ['.contrast > paper-slider', -20]); | 155 'changeValue', appId, ['.contrast > paper-slider', -20]); |
156 }).then(function() { | 156 }).then(function() { |
157 return gallery.callRemoteTestUtil('getMetadata', null, [url]); | 157 return gallery.callRemoteTestUtil('getMetadata', null, [url]); |
158 }).then(function(metadata) { | 158 }).then(function(metadata) { |
159 origMetadata = metadata; | 159 origMetadata = metadata; |
160 | 160 |
161 // Push the Enter key. | 161 // Push the Enter key. |
162 return gallery.fakeKeyDown(appId, 'body', 'Enter', false, false, false); | 162 return gallery.fakeKeyDown(appId, 'body', 'Enter', 'Enter', false, false, |
| 163 false); |
163 }).then(function() { | 164 }).then(function() { |
164 // Wait until the image is updated. | 165 // Wait until the image is updated. |
165 return repeatUntil(function() { | 166 return repeatUntil(function() { |
166 return gallery.callRemoteTestUtil('getMetadata', null, [url]) | 167 return gallery.callRemoteTestUtil('getMetadata', null, [url]) |
167 .then(function(metadata) { | 168 .then(function(metadata) { |
168 if (origMetadata.modificationTime != metadata.modificationTime) { | 169 if (origMetadata.modificationTime != metadata.modificationTime) { |
169 return true; | 170 return true; |
170 } else { | 171 } else { |
171 return pending( | 172 return pending( |
172 '%s is not updated. ' + | 173 '%s is not updated. ' + |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 return enableDisableOverwriteOriginalCheckbox('local', 'downloads'); | 300 return enableDisableOverwriteOriginalCheckbox('local', 'downloads'); |
300 }; | 301 }; |
301 | 302 |
302 /** | 303 /** |
303 * The enableDisableOverwriteOriginalCheckbox test for Drive. | 304 * The enableDisableOverwriteOriginalCheckbox test for Drive. |
304 * @return {Promise} Promise to be fulfilled with on success. | 305 * @return {Promise} Promise to be fulfilled with on success. |
305 */ | 306 */ |
306 testcase.enableDisableOverwriteOriginalCheckboxOnDrive = function() { | 307 testcase.enableDisableOverwriteOriginalCheckboxOnDrive = function() { |
307 return enableDisableOverwriteOriginalCheckbox('drive', 'drive'); | 308 return enableDisableOverwriteOriginalCheckbox('drive', 'drive'); |
308 }; | 309 }; |
OLD | NEW |