2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
5 <!-- The following script's response contains an Accept-CH header, and therefore must be synchronous
6 for the purpose of this test -->
7 <script src=
"../resources/accept-ch.php"></script>
9 var t
= async_test('Client-Hints not sent when Accept-CH header is present only in subresource');
10 var body
= document
.body
;
11 var unreached = function() {
12 assert_unreached("Image should not have loaded.");
15 var loadRWImage = function() {
16 var img
= new Image();
17 img
.src
= 'resources/image-checks-for-width.php';
18 img
.onload
= t
.step_func(unreached
);
19 img
.onerror
= t
.step_func(function(){ t
.done(); });
20 body
.appendChild(img
);
23 var img
= new Image();
24 img
.src
= 'resources/image-checks-for-dpr.php';
25 img
.onload
= t
.step_func(unreached
);
26 img
.onerror
= t
.step_func(loadRWImage
);
27 body
.appendChild(img
);