Skip to content

Commit 143920b

Browse files
vmpstrfoolip
authored andcommitted
VT cross doc: clean up wpts
This cleans up the WPTs for cross doc VT: - Convert everything to promise + popup tests since wpt runner doesn't support test page navs - Delete some tests that are hard to test without screenshots (we can re-add them in a different way when needed) Change-Id: I602bc44f7ebcd1e307070eff29d6b5674ee8272a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7551610 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Robert Flack <flackr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1582481}
1 parent 81ce049 commit 143920b

File tree

55 files changed

+594
-1638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+594
-1638
lines changed

css/css-view-transitions/navigation/at-rule-opt-in-auto-ref.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

css/css-view-transitions/navigation/at-rule-opt-in-auto.html

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
<!DOCTYPE html>
2-
<html class="reftest-wait">
32
<title>View Transitions: @view-transition opt in for auto</title>
43
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
54
<link rel="author" href="mailto:bokan@chromium.org">
6-
<link rel="match" href="at-rule-opt-in-auto-ref.html">
7-
<script src="/common/reftest-wait.js"></script>
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
87
<style>
98
@view-transition {
109
navigation: auto;
1110
}
12-
13-
html {
14-
background: blue;
15-
}
1611
</style>
1712
<script>
18-
function runTest() {
19-
const url = "resources/at-rule-opt-in-auto.html";
20-
window.location.replace(new URL(url, window.location));
13+
const params = new URLSearchParams(location.search);
14+
const mode = params.get("mode") || "test";
15+
16+
switch (mode) {
17+
case "test":
18+
promise_test(async t => {
19+
const result = await new Promise(resolve => {
20+
window.did_reveal = msg => { resolve(msg) };
21+
const popup = window.open("?mode=old");
22+
t.add_cleanup(() => popup.close());
23+
});
24+
assert_equals(result, "pass");
25+
});
26+
break;
27+
case "old":
28+
onload = () => requestAnimationFrame(() => requestAnimationFrame(() => {
29+
location.replace("?mode=new");
30+
}));
31+
break;
32+
case "new":
33+
onpagereveal = e => {
34+
window.opener.did_reveal(e.viewTransition ? "pass" : "fail");
35+
};
36+
break;
2137
}
22-
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
2338
</script>
24-
</html>

css/css-view-transitions/navigation/at-rule-opt-in-change-with-script.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
optIn();
1919

20-
// This file includes 3 modes: test, old, new.
21-
// "test" is where testharness runs. "old" -> "new" is where the view transition takes place.
2220
switch (params.get("mode") || "test") {
2321
case "test":
2422
promise_test(async t => {
@@ -40,7 +38,6 @@
4038
onpagereveal = e => window.opener.did_reveal(e);
4139
}
4240
</script>
43-
4441
<body>
45-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias quis assumenda doloremque, repellat quidem quia blanditiis harum animi corrupti totam sunt provident sapiente at eius sequi labore repellendus velit fugit!
46-
</body>
42+
Text
43+
</body>

css/css-view-transitions/navigation/at-rule-opt-in-none-in-new.html

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
<!DOCTYPE html>
2-
<html class="reftest-wait">
32
<title>View Transitions: @view-transition opt out in new document.</title>
43
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
54
<link rel="author" href="mailto:bokan@chromium.org">
6-
<link rel="match" href="at-rule-opt-in-none-ref.html">
7-
<script src="/common/reftest-wait.js"></script>
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
87
<style>
98
@view-transition {
109
navigation: auto;
1110
}
12-
html {
13-
background: blue;
14-
}
1511
</style>
1612
<script>
17-
function runTest() {
18-
const url = "resources/at-rule-opt-in-none.html";
19-
window.location.replace(new URL(url, window.location));
13+
const params = new URLSearchParams(location.search);
14+
const mode = params.get("mode") || "test";
15+
16+
switch (mode) {
17+
case "test":
18+
promise_test(async t => {
19+
const result = await new Promise(resolve => {
20+
window.did_reveal = e => { resolve(e) };
21+
const popup = window.open("?mode=old");
22+
t.add_cleanup(() => popup.close());
23+
});
24+
25+
assert_equals(result, "pass");
26+
});
27+
break;
28+
case "old":
29+
onload = () => requestAnimationFrame(() => requestAnimationFrame(() => {
30+
location.replace("resources/at-rule-opt-in-none.html");
31+
}));
32+
break;
2033
}
21-
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
2234
</script>
23-
</html>

css/css-view-transitions/navigation/at-rule-opt-in-none-in-old.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
<!DOCTYPE html>
2-
<html class="reftest-wait">
32
<title>View Transitions: @view-transition opt out in new document.</title>
43
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
54
<link rel="author" href="mailto:bokan@chromium.org">
6-
<link rel="match" href="at-rule-opt-in-none-ref.html">
7-
<script src="/common/reftest-wait.js"></script>
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
87
<style>
98
@view-transition {
109
navigation: none;
1110
}
12-
html {
13-
background: blue;
14-
}
1511
</style>
1612
<script>
17-
function runTest() {
18-
const url = "resources/at-rule-opt-in-auto.html";
19-
window.location.replace(new URL(url, window.location));
13+
const params = new URLSearchParams(location.search);
14+
const mode = params.get("mode") || "test";
15+
16+
switch (mode) {
17+
case "test":
18+
promise_test(async t => {
19+
const result = await new Promise(resolve => {
20+
window.did_reveal = msg => { resolve(msg) };
21+
const popup = window.open("?mode=old");
22+
t.add_cleanup(() => popup.close());
23+
});
24+
25+
assert_equals(result, "no viewTransition");
26+
});
27+
break;
28+
case "old":
29+
location.replace("resources/at-rule-opt-in-auto.html");
2030
}
21-
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
2231
</script>
23-
</html>

css/css-view-transitions/navigation/at-rule-opt-in-none-ref.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

css/css-view-transitions/navigation/auto-name-from-id-ref.html

Lines changed: 0 additions & 22 deletions
This file was deleted.

css/css-view-transitions/navigation/auto-name-from-id.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

css/css-view-transitions/navigation/custom-scrollbar.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

css/css-view-transitions/navigation/navigation-auto-excludes-reload-ref.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)