Skip to content

Commit 1deae95

Browse files
committed
Bug 1968383 Add more Trusted Types enforcement tests testing a source text transformed by the default policy. r=smaug
This verifies that the source text transformed by the default policy is used for various steps of "prepare the script element": https://html.spec.whatwg.org/#prepare-the-script-element PR w3c/trusted-types#579 Differential Revision: https://phabricator.services.mozilla.com/D251456 UltraBlame original commit: b40ba3e6cd668c9890ed7e4c6bdfdf2ee60cbcc4
1 parent 140fe59 commit 1deae95

12 files changed

+5153
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
[
2+
script
3+
-
4+
enforcement
5+
-
6+
005
7+
.
8+
html
9+
]
10+
[
11+
Empty
12+
HTMLScriptElement
13+
is
14+
executed
15+
if
16+
the
17+
default
18+
policy
19+
makes
20+
it
21+
non
22+
-
23+
empty
24+
.
25+
]
26+
expected
27+
:
28+
FAIL
29+
[
30+
Non
31+
-
32+
empty
33+
HTMLScriptElement
34+
is
35+
not
36+
executed
37+
if
38+
the
39+
default
40+
policy
41+
makes
42+
it
43+
empty
44+
.
45+
]
46+
expected
47+
:
48+
FAIL
49+
[
50+
Empty
51+
SVGScriptElement
52+
is
53+
executed
54+
if
55+
the
56+
default
57+
policy
58+
makes
59+
it
60+
non
61+
-
62+
empty
63+
.
64+
]
65+
expected
66+
:
67+
FAIL
68+
[
69+
Non
70+
-
71+
empty
72+
SVGScriptElement
73+
is
74+
not
75+
executed
76+
if
77+
the
78+
default
79+
policy
80+
makes
81+
it
82+
empty
83+
.
84+
]
85+
expected
86+
:
87+
FAIL
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[
2+
script
3+
-
4+
enforcement
5+
-
6+
006
7+
.
8+
html
9+
]
10+
expected
11+
:
12+
ERROR
13+
[
14+
Untrusted
15+
HTMLScriptElement
16+
with
17+
classic
18+
type
19+
uses
20+
the
21+
source
22+
text
23+
returned
24+
by
25+
the
26+
default
27+
policy
28+
.
29+
]
30+
expected
31+
:
32+
FAIL
33+
[
34+
Untrusted
35+
HTMLScriptElement
36+
of
37+
importmap
38+
type
39+
uses
40+
the
41+
source
42+
text
43+
returned
44+
by
45+
the
46+
default
47+
policy
48+
.
49+
]
50+
expected
51+
:
52+
FAIL
53+
[
54+
Untrusted
55+
HTMLScriptElement
56+
of
57+
module
58+
type
59+
uses
60+
the
61+
source
62+
text
63+
returned
64+
by
65+
the
66+
default
67+
policy
68+
.
69+
]
70+
expected
71+
:
72+
FAIL
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[
2+
script
3+
-
4+
enforcement
5+
-
6+
007
7+
.
8+
html
9+
]
10+
expected
11+
:
12+
ERROR
13+
[
14+
Untrusted
15+
SVGScriptElement
16+
with
17+
classic
18+
type
19+
uses
20+
the
21+
source
22+
text
23+
returned
24+
by
25+
the
26+
default
27+
policy
28+
.
29+
]
30+
expected
31+
:
32+
FAIL
33+
[
34+
Untrusted
35+
SVGScriptElement
36+
of
37+
importmap
38+
type
39+
uses
40+
the
41+
source
42+
text
43+
returned
44+
by
45+
the
46+
default
47+
policy
48+
.
49+
]
50+
expected
51+
:
52+
FAIL
53+
[
54+
Untrusted
55+
SVGScriptElement
56+
of
57+
module
58+
type
59+
uses
60+
the
61+
source
62+
text
63+
returned
64+
by
65+
the
66+
default
67+
policy
68+
.
69+
]
70+
expected
71+
:
72+
FAIL
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[
2+
script
3+
-
4+
enforcement
5+
-
6+
008
7+
.
8+
https
9+
.
10+
html
11+
]
12+
[
13+
Untrusted
14+
HTMLScriptElement
15+
with
16+
classic
17+
type
18+
uses
19+
the
20+
source
21+
text
22+
returned
23+
by
24+
the
25+
default
26+
policy
27+
for
28+
inline
29+
CSP
30+
check
31+
.
32+
]
33+
expected
34+
:
35+
FAIL
36+
[
37+
Untrusted
38+
HTMLScriptElement
39+
of
40+
importmap
41+
type
42+
uses
43+
the
44+
source
45+
text
46+
returned
47+
by
48+
the
49+
default
50+
policy
51+
for
52+
inline
53+
CSP
54+
check
55+
.
56+
]
57+
expected
58+
:
59+
FAIL
60+
[
61+
Untrusted
62+
HTMLScriptElement
63+
of
64+
module
65+
type
66+
uses
67+
the
68+
source
69+
text
70+
returned
71+
by
72+
the
73+
default
74+
policy
75+
for
76+
inline
77+
CSP
78+
check
79+
.
80+
]
81+
expected
82+
:
83+
FAIL

0 commit comments

Comments
 (0)