Skip to content

Commit

Permalink
Resources: send a documentHeight message after ampInitialized if heig…
Browse files Browse the repository at this point in the history
…ht has changed. (#28065)

* Resources: Wait until ampInitialized to send documentHeight

* switch to lower risk fix

* revert piece

* fix tests by adding vsync.measure() stub
  • Loading branch information
samouri committed Apr 28, 2020
1 parent 50459f1 commit 3c7b0b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/service/resources-impl.js
Expand Up @@ -647,6 +647,7 @@ export class ResourcesImpl {
/** @override */
ampInitComplete() {
this.ampInitialized_ = true;
this.maybeChangeHeight_ = true;
dev().fine(TAG_, 'ampInitComplete');
this.schedulePass();
}
Expand Down
1 change: 1 addition & 0 deletions test/unit/test-resources.js
Expand Up @@ -642,6 +642,7 @@ describes.realWin('Resources discoverWork', {amp: true}, (env) => {
resources.resources_ = [resource1, resource2];
resources.vsync_ = {
mutate: (callback) => callback(),
measure: (callback) => callback(),
measurePromise: (callback) => Promise.resolve(callback()),
};
});
Expand Down

0 comments on commit 3c7b0b3

Please sign in to comment.