You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Optimizing ad performance](#optimizing-ad-performance)
27
+
-[Ad markup](#ad-markup)
28
+
-[1st party cookies](#1st-party-cookies)
29
+
-[Developer guidelines for a pull request](#developer-guidelines-for-a-pull-request)
30
+
-[Files to change](#files-to-change)
31
+
-[Verify your examples](#verify-your-examples)
32
+
-[Tests](#tests)
33
+
-[Lint and type-check](#lint-and-type-check)
34
+
-[Other tips](#other-tips)
35
+
-[Developer announcements for ads related API changes](#developer-announcements-for-ads-related-api-changes)
36
36
37
37
## Overview
38
38
@@ -44,15 +44,15 @@ If you are an ad technology provider looking to integrate with AMP HTML, please
44
44
45
45
Below is a summary of constraints placed on external resources, such as ads in AMP HTML:
46
46
47
-
-Because AMP pages are served on HTTPS and ads cannot be proxied, ads must be served over HTTPS.
48
-
-The size of an ad unit must be static. It must be knowable without fetching the ad and it cannot change at runtime except through [iframe resizing](#ad-resizing).
49
-
-If placing the ad requires running JavaScript (assumed to be true for 100% of ads served through networks), the ad must be placed on an origin different from the AMP document itself. Reasons include:
50
-
-Improved security.
51
-
-Takes synchronous HTTP requests made by the ad out of the critical rendering path of the primary page.
52
-
-Allows browsers to run the ad in a different process from the primary page (even better security and prevents JS inside the ad to block the main page UI thread).
53
-
-Prevents ads doing less than optimal things to measure user behavior and other interference with the primary page.
54
-
-The AMP Runtime may at any moment decide that there are too many iframes on a page and that memory is low. In that case, the AMP Runtime unloads ads that were previously loaded and are no longer visible. It may later load new ads in the same slot if the user scrolls them back into view.
55
-
-The AMP Runtime may decide to set an ad that is currently not visible to `display: none` to reduce browser layout and compositing cost.
47
+
- Because AMP pages are served on HTTPS and ads cannot be proxied, ads must be served over HTTPS.
48
+
- The size of an ad unit must be static. It must be knowable without fetching the ad and it cannot change at runtime except through [iframe resizing](#ad-resizing).
49
+
- If placing the ad requires running JavaScript (assumed to be true for 100% of ads served through networks), the ad must be placed on an origin different from the AMP document itself. Reasons include:
50
+
- Improved security.
51
+
- Takes synchronous HTTP requests made by the ad out of the critical rendering path of the primary page.
52
+
- Allows browsers to run the ad in a different process from the primary page (even better security and prevents JS inside the ad to block the main page UI thread).
53
+
- Prevents ads doing less than optimal things to measure user behavior and other interference with the primary page.
54
+
- The AMP Runtime may at any moment decide that there are too many iframes on a page and that memory is low. In that case, the AMP Runtime unloads ads that were previously loaded and are no longer visible. It may later load new ads in the same slot if the user scrolls them back into view.
55
+
- The AMP Runtime may decide to set an ad that is currently not visible to `display: none` to reduce browser layout and compositing cost.
56
56
57
57
## The iframe sandbox
58
58
@@ -199,9 +199,9 @@ window.context
199
199
200
200
Here are some factors that affect whether the resize will be executed:
201
201
202
-
-Whether the resize is triggered by the user action;
203
-
-Whether the resize is requested for a currently active ad;
204
-
-Whether the resize is requested for an ad below the viewport or above the viewport.
202
+
- Whether the resize is triggered by the user action;
203
+
- Whether the resize is requested for a currently active ad;
204
+
- Whether the resize is requested for an ad below the viewport or above the viewport.
205
205
206
206
#### Specifying an overflow element
207
207
@@ -343,12 +343,12 @@ Please read through [developing.md](../docs/developing.md) before contributing t
343
343
344
344
If you're adding support for a new third-party ad service, changes to the following files are expected:
345
345
346
-
-`/ads/yournetwork.js`: Implement the main logic here. This is the code that's invoked in the third-party iframe once loaded.
347
-
-`/ads/yournetwork.md`: Documentation detailing yourr ad service for publishers to read.
348
-
-`/ads/_config.js`: Add service specific configuration here.
349
-
-`/3p/vendors/yournetwork.js`: Register your service here.
350
-
-`/extensions/amp-ad/amp-ad.md`: Add a link that points to your publisher doc.
351
-
-`/examples/ads.amp.html`: Add publisher examples here. Since a real ad isn't guaranteed to fill, a consistently displayed fake ad is highly recommended here to help AMP developers confidently identify new bugs.
346
+
-`/ads/yournetwork.js`: Implement the main logic here. This is the code that's invoked in the third-party iframe once loaded.
347
+
-`/ads/yournetwork.md`: Documentation detailing yourr ad service for publishers to read.
348
+
-`/ads/_config.js`: Add service specific configuration here.
349
+
-`/3p/vendors/yournetwork.js`: Register your service here.
350
+
-`/extensions/amp-ad/amp-ad.md`: Add a link that points to your publisher doc.
351
+
-`/examples/ads.amp.html`: Add publisher examples here. Since a real ad isn't guaranteed to fill, a consistently displayed fake ad is highly recommended here to help AMP developers confidently identify new bugs.
352
352
353
353
### Verify your examples
354
354
@@ -379,10 +379,10 @@ To speed up the review process, please run `amp lint` and `amp check-types`, the
379
379
380
380
### Other tips
381
381
382
-
-Add **cc ampproject/wg-monetization** in all pull request's descriptions.
383
-
-It's highly recommended to maintain [an integration test outside AMP repo](../3p/README.md#adding-proper-integration-tests).
384
-
-Please consider implementing the `render-start` and `no-content-available` APIs (see [Available APIs](#available-apis)), which helps AMP to provide user a much better ad loading experience.
385
-
-[CLA](../docs/contributing.md#contributing-code): for anyone who has trouble to pass the automatic CLA check in a pull request, try to follow the guidelines provided by the CLA Bot. Common mistakes are:
382
+
- Add **cc ampproject/wg-monetization** in all pull request's descriptions.
383
+
- It's highly recommended to maintain [an integration test outside AMP repo](../3p/README.md#adding-proper-integration-tests).
384
+
- Please consider implementing the `render-start` and `no-content-available` APIs (see [Available APIs](#available-apis)), which helps AMP to provide user a much better ad loading experience.
385
+
-[CLA](../docs/contributing.md#contributing-code): for anyone who has trouble to pass the automatic CLA check in a pull request, try to follow the guidelines provided by the CLA Bot. Common mistakes are:
386
386
1. Using a different email address in the git commit.
387
387
2. Not providing the exact company name in the PR thread.
@@ -16,19 +16,19 @@ be given preferential rendering.
16
16
amp markdown-toc --fix
17
17
-->
18
18
19
-
-[Background](#background)
20
-
-[Overview](#overview)
21
-
-[Detailed design](#detailed-design)
22
-
-[Ad server requirements](#ad-server-requirements)
23
-
-[SSL](#ssl)
24
-
-[AMPHTML ad creative signature](#amphtml-ad-creative-signature)
25
-
-[Ad response headers](#ad-response-headers)
26
-
-[Creating an AMPHTML ad extension implementation](#creating-an-amphtml-ad-extension-implementation)
27
-
-[Create the implementation script](#create-the-implementation-script)
28
-
-[Create the configuration file](#create-the-configuration-file)
29
-
-[Create documentation](#create-documentation)
30
-
-[Create tests](#create-tests)
31
-
-[Checklist for ad network implementation](#checklist-for-ad-network-implementation)
19
+
-[Background](#background)
20
+
-[Overview](#overview)
21
+
-[Detailed design](#detailed-design)
22
+
-[Ad server requirements](#ad-server-requirements)
23
+
- [SSL](#ssl)
24
+
- [AMPHTML ad creative signature](#amphtml-ad-creative-signature)
25
+
- [Ad response headers](#ad-response-headers)
26
+
-[Creating an AMPHTML ad extension implementation](#creating-an-amphtml-ad-extension-implementation)
27
+
-[Create the implementation script](#create-the-implementation-script)
28
+
-[Create the configuration file](#create-the-configuration-file)
29
+
-[Create documentation](#create-documentation)
30
+
-[Create tests](#create-tests)
31
+
-[Checklist for ad network implementation](#checklist-for-ad-network-implementation)
32
32
33
33
## Background
34
34
@@ -208,8 +208,7 @@ _For reference, see [Figure 1: Part A](#figure-1-fast-fetch-rendering-flow)_.
208
208
});
209
209
```
210
210
211
-
Example configs: [AdSense](https://github.com/ampproject/amphtml/blob/main/extensions/amp-ad-network-adsense-impl/0.1/adsense-a4a-config.js#L68).
212
-
Usage of Google Ad Manager and AdSense configs can be seen in [\_a4a-config.js](https://github.com/ampproject/amphtml/blob/main/ads/_a4a-config.js).
211
+
Example usage of Google Ad Manager and AdSense configs can be seen in [\_a4a-config.js](https://github.com/ampproject/amphtml/blob/main/ads/_a4a-config.js).
213
212
214
213
#### Create documentation
215
214
@@ -226,14 +225,14 @@ for your AMP ad network implementation.
226
225
227
226
## Checklist for ad network implementation
228
227
229
-
-[ ] All Server-AMP communication done withSSL
230
-
-[ ] AMP ads sent to validation server
231
-
-[ ] Validated AMP ads sent from network to AMPwith signature
232
-
-[ ] Validated AMP ads sent from network to AMPwith appropriate headers
233
-
-[ ] File hierarchy created within amphtml/extensions
Copy file name to clipboardExpand all lines: build-system/tasks/e2e/README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,22 @@ AMP contributors embrace testing to maintain confidence that their code is execu
10
10
11
11
<!-- {"maxdepth": 1} -->
12
12
13
-
-[What is an end-to-end test?](#what-is-an-end-to-end-test)
14
-
-[Choosing which features to test](#choosing-which-features-to-test)
15
-
-[Writing E2E tests](#writing-e2e-tests)
16
-
-[Debugging E2E tests](#debugging-e2e-tests)
13
+
-[What is an end-to-end test?](#what-is-an-end-to-end-test)
14
+
-[Choosing which features to test](#choosing-which-features-to-test)
15
+
-[Writing E2E tests](#writing-e2e-tests)
16
+
-[Debugging E2E tests](#debugging-e2e-tests)
17
17
18
18
This document is a usage guide. For full test command documentation, consult the following resource:
19
19
20
-
-[Information on executing tests](../../../docs/testing.md)
20
+
-[Information on executing tests](../../../docs/testing.md)
21
21
22
22
## What is an end-to-end test?
23
23
24
24
Let's compare the test types available to AMP contributors:
25
25
26
-
-Unit tests
27
-
-Integration tests
28
-
-End-to-end tests
26
+
- Unit tests
27
+
- Integration tests
28
+
- End-to-end tests
29
29
30
30
Unit tests are useful for testing individual behaviors of a feature or fix. They are cheap to execute since they use mocks heavily to eliminate dependencies that need to also be executed during testing. These should be the most common type of test for a feature. These should fail rarely for reasons other than bugs.
31
31
@@ -43,13 +43,13 @@ End-to-end tests are able to test a full page as the user's browser would load i
43
43
44
44
End-to-end tests should verify the most important user flows of a component. Prioritize tests for behaviors that would make the page appear very obviously broken if there was a failure. For example:
45
45
46
-
-The component's initial render
47
-
-Primary user interactions
48
-
-e.g. clicking the next button on a carousel
49
-
-Features with heavy usage by a large number of AMP publishers
50
-
-e.g. loading more content at the bottom of an amp page
51
-
-Important behaviors that are frequently broken
52
-
-e.g. browser updates often break video autoplay behavior
46
+
- The component's initial render
47
+
- Primary user interactions
48
+
- e.g. clicking the next button on a carousel
49
+
- Features with heavy usage by a large number of AMP publishers
50
+
- e.g. loading more content at the bottom of an amp page
51
+
- Important behaviors that are frequently broken
52
+
- e.g. browser updates often break video autoplay behavior
0 commit comments