Skip to content

Commit

Permalink
Validator rollup (#16972)
Browse files Browse the repository at this point in the history
* cl/205296221 Add validator test for amp-anim.

* cl/205299294 Minor cleanup to recent test addition

* cl/205299388 Add validator test for amp-yotpo.

* cl/205300941 Rename ExtensionSpec.allowed_versions

* cl/205304241 Add validator test for amp-dynamic-cs

* Fix lint errors.

* More lint fix

* Fix test after #16954
  • Loading branch information
alin04 committed Jul 20, 2018
1 parent caf1f10 commit f34a8b5
Show file tree
Hide file tree
Showing 106 changed files with 631 additions and 230 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-3d-gltf/validator-amp-3d-gltf.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-3d-gltf
tag_name: "SCRIPT"
extension_spec: {
name: "amp-3d-gltf"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-3q-player/validator-amp-3q-player.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-3q-player
tag_name: "SCRIPT"
extension_spec: {
name: "amp-3q-player"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
Expand Up @@ -20,9 +20,9 @@ tags: { # amp-access-laterpay
requires_extension: "amp-access"
extension_spec: {
name: "amp-access-laterpay"
allowed_versions: "0.1"
allowed_versions: "0.2"
allowed_versions: "latest"
version: "0.1"
version: "0.2"
version: "latest"
requires_usage: NONE
}
attr_lists: "common-extension-attrs"
Expand Down
Expand Up @@ -20,8 +20,8 @@ tags: { # amp-access-scroll
requires_extension: "amp-access"
extension_spec: {
name: "amp-access-scroll"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: NONE
}
attr_lists: "common-extension-attrs"
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-access/validator-amp-access.protoascii
Expand Up @@ -18,8 +18,8 @@ tags: { # amp-access
tag_name: "SCRIPT"
extension_spec: {
name: "amp-access"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-accordion/validator-amp-accordion.protoascii
Expand Up @@ -21,8 +21,8 @@ tags: { # amp-accordion
tag_name: "SCRIPT"
extension_spec: {
name: "amp-accordion"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-ad-exit/validator-amp-ad-exit.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-ad-exit
tag_name: "SCRIPT"
extension_spec {
name: "amp-ad-exit"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-ad/validator-amp-ad.protoascii
Expand Up @@ -36,8 +36,8 @@ tags: { # amp-ad
spec_name: "amp-ad extension .js script"
extension_spec: {
name: "amp-ad"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-addthis/validator-amp-addthis.protoascii
Expand Up @@ -18,8 +18,8 @@ tags: { # amp-addthis
html_format: AMP
tag_name: "SCRIPT"
extension_spec: {
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
name: "amp-addthis"
}
attr_lists: "common-extension-attrs"
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-analytics/validator-amp-analytics.protoascii
Expand Up @@ -22,8 +22,8 @@ tags: { # amp-analytics
tag_name: "SCRIPT"
extension_spec: {
name: "amp-analytics"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: NONE
deprecated_allow_duplicates: true
}
Expand Down
64 changes: 64 additions & 0 deletions extensions/amp-anim/0.1/test/validator-amp-anim.html
@@ -0,0 +1,64 @@
<!--
Copyright 2018 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the license.
-->
<!--
Test Description:
Tests for the amp-anim tag. See the inline comments.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html">
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-latest.js"></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<!-- Valid: Runtime-managed animated image. -->
<amp-anim
layout="responsive"
height="300"
width="400"
src="lemur.gif">
</amp-anim>

<!-- Valid: Runtime-managed animated image with optional attributes. -->
<amp-anim
alt="Lemurs"
attribution="National Geographic Channel"
layout="responsive"
height="300"
width="400"
src="lemur.gif">
</amp-anim>

<!-- Invalid: Missing src attribute. -->
<amp-anim
layout="responsive"
height="300"
width="400">
</amp-anim>

<!-- Invalid: illegal layout. -->
<amp-anim
layout="container"
height="300"
width="400"
src="lemur.gif">
</amp-anim>
</body>
</html>
69 changes: 69 additions & 0 deletions extensions/amp-anim/0.1/test/validator-amp-anim.out
@@ -0,0 +1,69 @@
FAIL
| <!--
| Copyright 2018 The AMP HTML Authors. All Rights Reserved.
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS-IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the license.
| -->
| <!--
| Test Description:
| Tests for the amp-anim tag. See the inline comments.
| -->
| <!doctype html>
| <html ⚡>
| <head>
| <meta charset="utf-8">
| <link rel="canonical" href="./regular-html-version.html">
| <meta name="viewport" content="width=device-width,minimum-scale=1">
| <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
| <script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-latest.js"></script>
| <script async src="https://cdn.ampproject.org/v0.js"></script>
| </head>
| <body>
| <!-- Valid: Runtime-managed animated image. -->
| <amp-anim
| layout="responsive"
| height="300"
| width="400"
| src="lemur.gif">
| </amp-anim>
|
| <!-- Valid: Runtime-managed animated image with optional attributes. -->
| <amp-anim
| alt="Lemurs"
| attribution="National Geographic Channel"
| layout="responsive"
| height="300"
| width="400"
| src="lemur.gif">
| </amp-anim>
|
| <!-- Invalid: Missing src attribute. -->
| <amp-anim
>> ^~~~~~~~~
amp-anim/0.1/test/validator-amp-anim.html:50:2 The mandatory attribute 'src' is missing in tag 'amp-anim'. (see https://www.ampproject.org/docs/reference/components/amp-anim) [AMP_TAG_PROBLEM]
| layout="responsive"
| height="300"
| width="400">
| </amp-anim>
|
| <!-- Invalid: illegal layout. -->
| <amp-anim
>> ^~~~~~~~~
amp-anim/0.1/test/validator-amp-anim.html:57:2 The specified layout 'CONTAINER' is not supported by tag 'amp-anim'. (see https://www.ampproject.org/docs/reference/components/amp-anim) [AMP_LAYOUT_PROBLEM]
| layout="container"
| height="300"
| width="400"
| src="lemur.gif">
| </amp-anim>
| </body>
| </html>
8 changes: 4 additions & 4 deletions extensions/amp-anim/validator-amp-anim.protoascii
Expand Up @@ -21,8 +21,8 @@ tags: { # amp-anim
tag_name: "SCRIPT"
extension_spec: {
name: "amp-anim"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand All @@ -34,8 +34,8 @@ tags: { # amp-anim
spec_name: "amp-anim extension .js script (AMP4EMAIL)"
extension_spec: {
name: "amp-anim"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-animation/validator-amp-animation.protoascii
Expand Up @@ -21,8 +21,8 @@ tags: { # amp-animation
tag_name: "SCRIPT"
extension_spec: {
name: "amp-animation"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-apester-media
tag_name: "SCRIPT"
extension_spec: {
name: "amp-apester-media"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-app-banner/validator-amp-app-banner.protoascii
Expand Up @@ -18,8 +18,8 @@ tags: { # <script custom-element="amp-sticky-ad">
tag_name: "SCRIPT"
extension_spec: {
name: "amp-app-banner"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
deprecated_allow_duplicates: true
}
attr_lists: "common-extension-attrs"
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-audio/validator-amp-audio.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-audio
tag_name: "SCRIPT"
extension_spec: {
name: "amp-audio"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
deprecated_allow_duplicates: true
requires_usage: GRANDFATHERED
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-auto-ads/validator-amp-auto-ads.protoascii
Expand Up @@ -18,8 +18,8 @@ tags: { # amp-auto-ads
tag_name: "SCRIPT"
extension_spec: {
name: "amp-auto-ads"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-beopinion/validator-amp-beopinion.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-beopinion
tag_name: "SCRIPT"
extension_spec: {
name: "amp-beopinion"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-bind/validator-amp-bind.protoascii
Expand Up @@ -21,8 +21,8 @@ tags: { # amp-bind
tag_name: "SCRIPT"
extension_spec: {
name: "amp-bind"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
# amp-bind has no associated tag which indicates usage of the extension.
# TODO(gregable): Implement a mechanism to associate attributes with
# extension usage and then set this to GRANDFATHERED or ERROR.
Expand Down
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-bodymovin-animation
tag_name: "SCRIPT"
extension_spec: {
name: "amp-bodymovin-animation"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-brid-player
tag_name: "SCRIPT"
extension_spec: {
name: "amp-brid-player"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-brightcove/validator-amp-brightcove.protoascii
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-brightcove
tag_name: "SCRIPT"
extension_spec: {
name: "amp-brightcove"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
Expand Down
Expand Up @@ -19,8 +19,8 @@ tags: { # amp-byside-content
tag_name: "SCRIPT"
extension_spec: {
name: "amp-byside-content"
allowed_versions: "0.1"
allowed_versions: "latest"
version: "0.1"
version: "latest"
}
attr_lists: "common-extension-attrs"
}
Expand Down

0 comments on commit f34a8b5

Please sign in to comment.