no-crash-set-exception.html (1673B)
1 <!DOCTYPE html> 2 <html> 3 <title>View transitions: exception thrown during transition</title> 4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 5 <link rel="author" href="mailto:khushalsagar@chromium.org"> 6 7 <script src="/dom/events/scrolling/scroll_support.js"></script> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 11 <style> 12 div { 13 width: 100px; 14 height: 100px; 15 background: blue; 16 contain: paint; 17 view-transition-name: shared; 18 } 19 20 html::view-transition, 21 html::view-transition-group(shared), 22 html::view-transition-image-pair(shared), 23 html::view-transition-old(shared), 24 html::view-transition-new(shared) { 25 background: blue; 26 } 27 </style> 28 29 <div></div> 30 31 <script> 32 promise_test(async t => { 33 assert_implements(document.startViewTransition, "Missing document.startViewTransition"); 34 await waitForCompositorReady(); 35 const vt = document.startViewTransition(() => { 36 throw "error"; 37 }); 38 let update_callback_resolution; 39 let ready_resolution; 40 let finished_resolution; 41 42 await vt.updateCallbackDone.then( 43 () => { update_callback_resolution = "fulfilled" }, 44 () => { update_callback_resolution = "rejected" }); 45 await vt.ready.then( 46 () => { ready_resolution = "fulfilled" }, 47 () => { ready_resolution = "rejected" }); 48 await vt.finished.then( 49 () => { finished_resolution = "fulfilled" }, 50 () => { finished_resolution = "rejected" }); 51 52 assert_equals(update_callback_resolution, "rejected"); 53 assert_equals(ready_resolution, "rejected"); 54 assert_equals(finished_resolution, "rejected"); 55 }, "An exception thrown during a transition shouldn't crash."); 56 57 </script>