Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that disables it given conditions:
- os == "android" : Windows cannot be minimized
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-view-transitions/navigation/hide-before-reveal.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>View transitions: pagereveal event provides viewTransition</title>
<meta name="timeout" content="long">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/page-visibility/resources/window_state_context.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// This is required to prevent the test harness from failing the test
// when the unhandled promise rejection occurs.
setup({ allow_uncaught_exception: true });
promise_test(async t => {
let popup;
t.add_cleanup(() => popup.close());
const restored = new Promise(resolve => { window.did_restore = resolve; });
const event = await new Promise(resolve => {
window.did_reveal = resolve;
popup = window.open("resources/hide-before-reveal-popup.html?mode=old");
});
// Don't close the popup while its testdriver actions are still pending.
await restored;
assert_equals(event.viewTransition, null,
"Transition should have been skipped when document was minimized");
});
</script>