Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrumentation to embed iframe #1534

Merged
merged 1 commit into from
Jan 26, 2016

Conversation

cramforce
Copy link
Member

No description provided.

const setInterval = win.setInterval;
const intervals = {};
let intervalId = 0;
win.setInterval = function(fn, time) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point in overriding this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to chat offline about reasons.

@cramforce cramforce force-pushed the ads-intervention branch 2 times, most recently from 39db54a to 6768275 Compare January 22, 2016 22:14
parent.ampManageWin = function(win) {
manageWin(win);
};
html = html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another +=?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@cramforce cramforce force-pushed the ads-intervention branch 3 times, most recently from 855c9d3 to 5481383 Compare January 23, 2016 00:04
@cramforce
Copy link
Member Author

This is now ready for review.

* @type {{inViewport: true}}
* @visibleForTesting
*/
export const docState = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a module variable here, with a setter method for testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@cramforce cramforce force-pushed the ads-intervention branch 2 times, most recently from 751934a to 52190f3 Compare January 25, 2016 23:14
@cramforce
Copy link
Member Author

PTAL

*/
export function getDocStateForTesting() {
return docState;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a setter, there's no longer a need for a docState object.

let inViewport = true;

export function setViewportForTesting(value) {
  inViewport = value
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dvoytenko
Copy link
Contributor

LGTM from me.

@jridgewell
Copy link
Contributor

:shipit:

cramforce added a commit that referenced this pull request Jan 26, 2016
Add instrumentation to embed iframe
@cramforce cramforce merged commit d3c7ed1 into ampproject:master Jan 26, 2016
@cramforce cramforce deleted the ads-intervention branch January 26, 2016 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants