Skip to content

Commit e9505ed

Browse files
committed
LibWeb: Add a bunch of eval tests in the trusted-types category
1 parent 5c1397f commit e9505ed

29 files changed

+974
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Harness status: OK
2+
3+
Found 6 tests
4+
5+
6 Pass
6+
Pass Blocked eval in Window.
7+
Pass Blocked indirect eval in Window.
8+
Pass Blocked Function constructor in Window.
9+
Pass Blocked AsyncFunction constructor in Window.
10+
Pass Blocked GeneratorFunction constructor in Window.
11+
Pass Blocked AsyncGeneratorFunction constructor in Window.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass eval with plain string throws (both block).
7+
Pass eval with TrustedScript throws (script-src blocks).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Harness status: OK
2+
3+
Found 7 tests
4+
5+
7 Pass
6+
Pass eval of TrustedScript works.
7+
Pass indirect eval of TrustedScript works.
8+
Pass eval of string works.
9+
Pass indirect eval of string works.
10+
Pass eval of !TrustedScript and !string works.
11+
Pass Function constructor of TrustedScript works.
12+
Pass Function constructor of string works.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Harness status: OK
2+
3+
Found 6 tests
4+
5+
6 Pass
6+
Pass eval of string where default policy mutates value throws.
7+
Pass indirect eval of string where default policy mutates value throws.
8+
Pass Function constructor with string where default policy mutates value throws.
9+
Pass AsyncFunction constructor with string where default policy mutates value throws.
10+
Pass GeneratorFunction constructor with string where default policy mutates value throws.
11+
Pass AsyncGeneratorFunction constructor with string where default policy mutates value throws.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Harness status: OK
2+
3+
Found 24 tests
4+
5+
24 Pass
6+
Pass eval of TrustedScript works.
7+
Pass indirect eval of TrustedScript works.
8+
Pass eval of string works.
9+
Pass eval of !TrustedScript and !string works.
10+
Pass Function constructor of TrustedScript works.
11+
Pass Function constructor of string works.
12+
Pass Function constructor of all TrustedScripts works.
13+
Pass Function constructor of all strings works.
14+
Pass Function constructor of string and TrustedScript works.
15+
Pass Async Function constructor of TrustedScript works.
16+
Pass AsyncFunction constructor of string works.
17+
Pass AsyncFunction constructor of all TrustedScripts works.
18+
Pass AsyncFunction constructor of all strings works.
19+
Pass AsyncFunction constructor of string and TrustedScript works.
20+
Pass GeneratorFunction constructor of TrustedScript works.
21+
Pass GeneratorFunction constructor of string works.
22+
Pass GeneratorFunction constructor of all TrustedScripts works.
23+
Pass GeneratorFunction constructor of all strings works.
24+
Pass GeneratorFunction constructor of string and TrustedScript works.
25+
Pass AsyncGeneratorFunction constructor of TrustedScript works.
26+
Pass AsyncGeneratorFunction constructor of string works.
27+
Pass AsyncGeneratorFunction constructor of all TrustedScripts works.
28+
Pass AsyncGeneratorFunction constructor of all strings works.
29+
Pass AsyncGeneratorFunction constructor of string and TrustedScript works.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Harness status: OK
2+
3+
Found 13 tests
4+
5+
13 Pass
6+
Pass eval of TrustedScript works.
7+
Pass indirect eval of TrustedScript works.
8+
Pass eval of string fails.
9+
Pass indirect eval of string fails.
10+
Pass eval of !TrustedScript and !string works.
11+
Pass Function constructor of TrustedScript works.
12+
Pass Function constructor of string fails.
13+
Pass Function constructor of all TrustedScripts works.
14+
Pass Function constructor of all strings fails.
15+
Pass Function constructor of string and TrustedScript fails.
16+
Pass AsyncFunction constructor of string fails.
17+
Pass GeneratorFunction constructor of string fails.
18+
Pass AsyncGeneratorFunction constructor of string fails.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Harness status: OK
2+
3+
Found 16 tests
4+
5+
16 Pass
6+
Pass plain string at index 0 (default policy modifying the function text).
7+
Pass plain string at index 1 (default policy modifying the function text).
8+
Pass plain string at index 2 (default policy modifying the function text).
9+
Pass plain string at index 3 (default policy modifying the function text).
10+
Pass plain string at index 0 (default policy leaving the function text unchanged).
11+
Pass plain string at index 1 (default policy leaving the function text unchanged).
12+
Pass plain string at index 2 (default policy leaving the function text unchanged).
13+
Pass plain string at index 3 (default policy leaving the function text unchanged).
14+
Pass TrustedScript with forged toString() at index 0 (default policy modifying the function text).
15+
Pass TrustedScript with forged toString() at index 1 (default policy modifying the function text).
16+
Pass TrustedScript with forged toString() at index 2 (default policy modifying the function text).
17+
Pass TrustedScript with forged toString() at index 3 (default policy modifying the function text).
18+
Pass TrustedScript with forged toString() at index 0 (default policy leaving the function text unchanged).
19+
Pass TrustedScript with forged toString() at index 1 (default policy leaving the function text unchanged).
20+
Pass TrustedScript with forged toString() at index 2 (default policy leaving the function text unchanged).
21+
Pass TrustedScript with forged toString() at index 3 (default policy leaving the function text unchanged).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass EvalError thrown if the callback of the default policy throws an error (eval).
7+
Pass EvalError thrown if the callback of the default policy throws an error (new Function).
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Harness status: OK
2+
3+
Found 65 tests
4+
5+
65 Pass
6+
Pass Function constructor with mixed plain and trusted strings, mask #0
7+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #0
8+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #0
9+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #0
10+
Pass Function constructor with mixed plain and trusted strings, mask #1
11+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #1
12+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #1
13+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #1
14+
Pass Function constructor with mixed plain and trusted strings, mask #2
15+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #2
16+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #2
17+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #2
18+
Pass Function constructor with mixed plain and trusted strings, mask #3
19+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #3
20+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #3
21+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #3
22+
Pass Function constructor with mixed plain and trusted strings, mask #4
23+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #4
24+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #4
25+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #4
26+
Pass Function constructor with mixed plain and trusted strings, mask #5
27+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #5
28+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #5
29+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #5
30+
Pass Function constructor with mixed plain and trusted strings, mask #6
31+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #6
32+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #6
33+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #6
34+
Pass Function constructor with mixed plain and trusted strings, mask #7
35+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #7
36+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #7
37+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #7
38+
Pass Function constructor with mixed plain and trusted strings, mask #8
39+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #8
40+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #8
41+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #8
42+
Pass Function constructor with mixed plain and trusted strings, mask #9
43+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #9
44+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #9
45+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #9
46+
Pass Function constructor with mixed plain and trusted strings, mask #10
47+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #10
48+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #10
49+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #10
50+
Pass Function constructor with mixed plain and trusted strings, mask #11
51+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #11
52+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #11
53+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #11
54+
Pass Function constructor with mixed plain and trusted strings, mask #12
55+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #12
56+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #12
57+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #12
58+
Pass Function constructor with mixed plain and trusted strings, mask #13
59+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #13
60+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #13
61+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #13
62+
Pass Function constructor with mixed plain and trusted strings, mask #14
63+
Pass AsyncFunction constructor with mixed plain and trusted strings, mask #14
64+
Pass GeneratorFunction constructor with mixed plain and trusted strings, mask #14
65+
Pass AsyncGeneratorFunction constructor with mixed plain and trusted strings, mask #14
66+
Pass Function constructor with mixed plain and trusted strings, mask #15
67+
Pass Function constructor with trusted strings, and a forged toString() for the one at index 0
68+
Pass Function constructor with trusted strings, and a forged toString() for the one at index 1
69+
Pass Function constructor with trusted strings, and a forged toString() for the one at index 2
70+
Pass Function constructor with trusted strings, and a forged toString() for the one at index 3
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Harness status: OK
2+
3+
Found 7 tests
4+
5+
7 Pass
6+
Pass eval of TrustedScript works.
7+
Pass indirect eval of TrustedScript works.
8+
Pass eval of string works and does not call a default policy.
9+
Pass indirect eval of string works and does not call a default policy.
10+
Pass eval of !TrustedScript and !string works.
11+
Pass Function constructor of TrustedScript works.
12+
Pass Function constructor of string works and does not call a default policy.

0 commit comments

Comments
 (0)