* Runs vsync task: measure followed by mutate. Returns the promise that * will be resolved as soon as the task has been completed. * * If state is not provided, the value passed to the measure and mutate * will be undefined. * * @param {!VsyncTaskSpecDef} task * @param {!VsyncSt
(task, opt_state)
| 185 | * @return {!Promise} |
| 186 | */ |
| 187 | runPromise(task, opt_state) { |
| 188 | this.run(task, opt_state); |
| 189 | if (this.nextFramePromise_) { |
| 190 | return this.nextFramePromise_; |
| 191 | } |
| 192 | const deferred = new Deferred(); |
| 193 | this.nextFrameResolver_ = deferred.resolve; |
| 194 | return (this.nextFramePromise_ = deferred.promise); |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Creates a function that will call {@link run} method. |
no test coverage detected