subresource-integrity-partial-image.html (1190B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Subresource Integrity Check + preload + partial image rendering</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <script> 8 // https://crbug.com/1058045: Chromium crashed when: 9 // 1. <link rel="preload" as="image" integrity="..." href="url"> 10 // (strictly speaking the preload scannner) starts preloading the image, 11 // and the image url takes some time for loading, 12 // 2. <img> loads the same URL and renders the partial image after some image 13 // data is received but before fully loaded, and then 14 // 3. the image is loaded and integrity check is done. 15 16 const t = async_test( 17 "<link rel='image'> with progressive image shouldn't crash"); 18 19 </script> 20 21 <link 22 rel="preload" 23 as="image" 24 integrity="sha256-Ly1v7MxPoMXjm9Dwrr4mDCVUe1PAA781vd0G8xvgpj8=" 25 href="/element-timing/resources/progressive-image.py?name=square100.png&numInitial=7500&sleep=1000"> 26 <img src="/element-timing/resources/progressive-image.py?name=square100.png&numInitial=7500&sleep=1000" 27 onload="t.step_func_done()()" 28 onerror="t.unreached_func('image should load because SRI is not checked')()">