OLD | NEW |
1 <?php | 1 <?php |
2 header("ACCEPT-CH: DPRW"); | 2 header("ACCEPT-CH: DPRW"); |
3 ?> | 3 ?> |
4 <!DOCTYPE html> | 4 <!DOCTYPE html> |
5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 var t = async_test('Client-Hints not sent when Accept-CH header is prese
nt but invalid'); | 9 var t = async_test('Client-Hints not sent when Accept-CH header is prese
nt but invalid'); |
10 var unreached = function() { | 10 var unreached = function() { |
11 assert_unreached("Image should not have loaded."); | 11 assert_unreached("Image should not have loaded."); |
12 }; | 12 }; |
13 | 13 |
| 14 var loadDeviceRAMImage = function() { |
| 15 var img = new Image(); |
| 16 img.src = 'resources/image-checks-for-device-ram.php'; |
| 17 img.onload = t.step_func(unreached); |
| 18 img.onerror = t.step_func(function(){ t.done(); }); |
| 19 document.body.appendChild(img); |
| 20 }; |
14 var loadRWImage = function() { | 21 var loadRWImage = function() { |
15 var img = new Image(); | 22 var img = new Image(); |
16 img.src = 'resources/image-checks-for-rw.php'; | 23 img.src = 'resources/image-checks-for-rw.php'; |
17 img.onload = t.step_func(unreached); | 24 img.onload = t.step_func(unreached); |
18 img.onerror = t.step_func(function(){ t.done(); }); | 25 img.onerror = t.step_func(loadDeviceRAMImage); |
19 document.body.appendChild(img); | 26 document.body.appendChild(img); |
20 }; | 27 }; |
21 t.step(function() { | 28 t.step(function() { |
22 var img = new Image(); | 29 var img = new Image(); |
23 img.src = 'resources/image-checks-for-dpr.php'; | 30 img.src = 'resources/image-checks-for-dpr.php'; |
24 img.onload = t.step_func(unreached); | 31 img.onload = t.step_func(unreached); |
25 img.onerror = t.step_func(loadRWImage); | 32 img.onerror = t.step_func(loadRWImage); |
26 document.body.appendChild(img); | 33 document.body.appendChild(img); |
27 }); | 34 }); |
28 </script> | 35 </script> |
29 </body> | 36 </body> |
OLD | NEW |