* Send message to runtime requesting to resize ad to height and width. * This is not guaranteed to succeed. All this does is make the request. * @param {number|undefined} width The new width for the ad we are requesting. * @param {number|undefined} height The new height for the ad we
(width, height, hasOverflow)
| 218 | * @return {Promise} Signify the success/failure of the request. |
| 219 | */ |
| 220 | requestResize(width, height, hasOverflow) { |
| 221 | const requestId = this.nextResizeRequestId_++; |
| 222 | this.client_.sendMessage(MessageType_Enum.EMBED_SIZE, { |
| 223 | 'id': requestId, |
| 224 | 'width': width, |
| 225 | 'height': height, |
| 226 | 'hasOverflow': hasOverflow, |
| 227 | }); |
| 228 | const deferred = new Deferred(); |
| 229 | this.resizeIdToDeferred_[requestId] = deferred; |
| 230 | return deferred.promise; |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * Set up listeners to handle responses from request size. |
no test coverage detected