7
7
// AUTOGENERATED. DO NOT EDIT.
8
8
// clang-format off
9
9
10
- goog . provide ( 'goog.html.safeUrlTestVectors' ) ;
10
+ goog . module ( 'goog.html.safeUrlTestVectors' ) ;
11
11
goog . setTestOnly ( 'goog.html.safeUrlTestVectors' ) ;
12
12
13
- goog . html . safeUrlTestVectors . BASE_VECTORS = [
13
+ /** @typedef {{input: string, expected: string, safe: boolean } } */
14
+ let TestVector ;
15
+
16
+ /** @const {!Array<!TestVector>} */
17
+ const BASE_VECTORS = [
14
18
{ input : '' , expected : '' , safe : true } ,
15
19
{ input : 'http://example.com/' , expected : 'http://example.com/' , safe : true } ,
16
20
{ input : 'https://example.com' , expected : 'https://example.com' , safe : true } ,
@@ -71,7 +75,8 @@ goog.html.safeUrlTestVectors.BASE_VECTORS = [
71
75
{ input : 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D' , expected : 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D' , safe : true }
72
76
] ;
73
77
74
- goog . html . safeUrlTestVectors . TEL_VECTORS = [
78
+ /** @const {!Array<!TestVector>} */
79
+ const TEL_VECTORS = [
75
80
{ input : 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29' , expected : 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29' , safe : true } ,
76
81
{ input : 'tEL:123;randmomparam\u003D123' , expected : 'tEL:123;randmomparam\u003D123' , safe : true } ,
77
82
{ input : ':' , expected : 'about:invalid#zClosurez' , safe : false } ,
@@ -82,18 +87,22 @@ goog.html.safeUrlTestVectors.TEL_VECTORS = [
82
87
{ input : 'tel:+1234567890' , expected : 'tel:+1234567890' , safe : true }
83
88
] ;
84
89
85
- goog . html . safeUrlTestVectors . SMS_VECTORS = [
90
+ /** @const {!Array<!TestVector>} */
91
+ const SMS_VECTORS = [
86
92
{ input : 'sms:+1234567890' , expected : 'sms:+1234567890' , safe : true } ,
87
93
{ input : 'sms:?body\u003Dmessage' , expected : 'sms:?body\u003Dmessage' , safe : true } ,
88
94
{ input : 'sms:?body\u003DHello, World!' , expected : 'about:invalid#zClosurez' , safe : false } ,
89
95
{ input : 'sms:?body\u003Da\u0026body\u003Db' , expected : 'about:invalid#zClosurez' , safe : false }
90
96
] ;
91
97
92
- goog . html . safeUrlTestVectors . SSH_VECTORS = [
98
+ /** @const {!Array<!TestVector>} */
99
+ const SSH_VECTORS = [
93
100
{ input : 'ssh://cloud.google.com' , expected : 'ssh://cloud.google.com' , safe : true } ,
94
101
{ input : '' , expected : 'about:invalid#zClosurez' , safe : false } ,
95
102
{ input : ':' , expected : 'about:invalid#zClosurez' , safe : false } ,
96
103
{ input : 'ssh:cloud.google.com' , expected : 'about:invalid#zClosurez' , safe : false } ,
97
104
{ input : ' ssh://cloud.google.com' , expected : 'about:invalid#zClosurez' , safe : false } ,
98
105
{ input : 'javascript:evil()' , expected : 'about:invalid#zClosurez' , safe : false }
99
106
] ;
107
+
108
+ exports = { BASE_VECTORS , TEL_VECTORS , SMS_VECTORS , SSH_VECTORS } ;
0 commit comments