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 25 matching lines...) Expand all Loading... |
36 bounds.outerHeight); | 36 bounds.outerHeight); |
37 } | 37 } |
38 return true; | 38 return true; |
39 }); | 39 }); |
40 }); | 40 }); |
41 }); | 41 }); |
42 | 42 |
43 return resizedWindowPromise.then(function() { | 43 return resizedWindowPromise.then(function() { |
44 var rootElementPromise = | 44 var rootElementPromise = |
45 gallery.waitForElement(appId, '.gallery[mode="slide"]'); | 45 gallery.waitForElement(appId, '.gallery[mode="slide"]'); |
46 var imagePromise = gallery.waitForElement( | |
47 appId, '.gallery .content canvas.image[width="760"]'); | |
48 var fullImagePromsie = gallery.waitForElement( | 46 var fullImagePromsie = gallery.waitForElement( |
49 appId, '.gallery .content canvas.fullres[width="800"]'); | 47 appId, '.gallery .image-container > .image'); |
50 return Promise.all([rootElementPromise, imagePromise, fullImagePromsie]). | 48 return Promise.all([rootElementPromise, fullImagePromsie]). |
51 then(function(args) { | 49 then(function(args) { |
52 chrome.test.assertEq('760', args[1].attributes.width); | 50 chrome.test.assertEq(760, args[1].renderedWidth); |
53 chrome.test.assertEq('570', args[1].attributes.height); | 51 chrome.test.assertEq(570, args[1].renderedHeight); |
54 chrome.test.assertEq('800', args[2].attributes.width); | 52 chrome.test.assertEq(800, args[1].imageWidth); |
55 chrome.test.assertEq('600', args[2].attributes.height); | 53 chrome.test.assertEq(600, args[1].imageHeight); |
56 }); | 54 }); |
57 }); | 55 }); |
58 }); | 56 }); |
59 } | 57 } |
60 | 58 |
61 /** | 59 /** |
62 * Confirms that two images are loaded in thumbnail mode. This method doesn't | 60 * Confirms that two images are loaded in thumbnail mode. This method doesn't |
63 * care whether two images are loaded with error or not. | 61 * care whether two images are loaded with error or not. |
64 * | 62 * |
65 * @param {string} appId | 63 * @param {string} appId |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return openMultipleImages('drive', 'drive'); | 153 return openMultipleImages('drive', 'drive'); |
156 }; | 154 }; |
157 | 155 |
158 /** | 156 /** |
159 * The openMultipleImagesAndChangeToSlideMode test for Downloads. | 157 * The openMultipleImagesAndChangeToSlideMode test for Downloads. |
160 * @return {Promise} Promise to be fulfilled with on success. | 158 * @return {Promise} Promise to be fulfilled with on success. |
161 */ | 159 */ |
162 testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() { | 160 testcase.openMultipleImagesAndChangeToSlideModeOnDownloads = function() { |
163 return openMultipleImagesAndChangeToSlideMode('local', 'downloads'); | 161 return openMultipleImagesAndChangeToSlideMode('local', 'downloads'); |
164 }; | 162 }; |
OLD | NEW |