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 * Class to manipulate the window in the remote extension. | 8 * Class to manipulate the window in the remote extension. |
9 * | 9 * |
10 * @param {string} extensionId ID of extension to be manipulated. | 10 * @param {string} extensionId ID of extension to be manipulated. |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if (width) | 425 if (width) |
426 expected.width = width; | 426 expected.width = width; |
427 if (height) | 427 if (height) |
428 expected.height = height; | 428 expected.height = height; |
429 if (name) | 429 if (name) |
430 expected.name = name; | 430 expected.name = name; |
431 | 431 |
432 return repeatUntil(function() { | 432 return repeatUntil(function() { |
433 var query = '.gallery[mode="slide"] .content canvas.fullres'; | 433 var query = '.gallery[mode="slide"] .content canvas.fullres'; |
434 return Promise.all([ | 434 return Promise.all([ |
435 this.waitForElement(windowId, '.filename-spacer > paper-input'), | 435 this.waitForElement(windowId, '.filename-spacer input'), |
436 this.waitForElement(windowId, query) | 436 this.waitForElement(windowId, query) |
437 ]).then(function(args) { | 437 ]).then(function(args) { |
438 var nameBox = args[0]; | 438 var nameBox = args[0]; |
439 var fullResCanvas = args[1]; | 439 var fullResCanvas = args[1]; |
440 var actual = {}; | 440 var actual = {}; |
441 if (width && fullResCanvas) | 441 if (width && fullResCanvas) |
442 actual.width = Number(fullResCanvas.attributes.width); | 442 actual.width = Number(fullResCanvas.attributes.width); |
443 if (height && fullResCanvas) | 443 if (height && fullResCanvas) |
444 actual.height = Number(fullResCanvas.attributes.height); | 444 actual.height = Number(fullResCanvas.attributes.height); |
445 if (name && nameBox) | 445 if (name && nameBox) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 * @param {string} name File name to be selected. | 494 * @param {string} name File name to be selected. |
495 * @return {!Promise<boolean>} A promise which will be resolved with true if the | 495 * @return {!Promise<boolean>} A promise which will be resolved with true if the |
496 * thumbnail has clicked. This method does not guarantee whether the | 496 * thumbnail has clicked. This method does not guarantee whether the |
497 * thumbnail has actually selected or not. | 497 * thumbnail has actually selected or not. |
498 */ | 498 */ |
499 RemoteCallGallery.prototype.selectImageInThumbnailMode = function(appId, name) { | 499 RemoteCallGallery.prototype.selectImageInThumbnailMode = function(appId, name) { |
500 return this.callRemoteTestUtil('fakeMouseClick', appId, | 500 return this.callRemoteTestUtil('fakeMouseClick', appId, |
501 ['.thumbnail-view > ul > li[aria-label="' + name + | 501 ['.thumbnail-view > ul > li[aria-label="' + name + |
502 '"] > .selection.frame']); | 502 '"] > .selection.frame']); |
503 }; | 503 }; |
OLD | NEW |