Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <?php | 1 <?php |
| 2 header("ACCEPT-CH: DPR, Width, Viewport-Width"); | 2 header("ACCEPT-CH: DPR, Width, Viewport-Width"); |
| 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 sent when Accept-CH header is present') ; | 9 var t = async_test('Client-Hints sent when Accept-CH header is present') ; |
| 10 var unreached = function() { | 10 var unreached = function() { |
| 11 assert_unreached("Image should have loaded."); | 11 assert_unreached("Image should have loaded."); |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 var loadRWImage = function() { | 14 var loadRWImage = function() { |
| 15 var img = new Image(); | 15 var img = new Image(); |
| 16 img.src = 'resources/image-checks-for-width.php'; | 16 img.src = 'resources/image-checks-for-width.php'; |
| 17 img.width = '500'; | |
|
Mike West
2015/06/18 06:20:03
Can you help me understand how this is testing the
Yoav Weiss
2015/06/18 06:30:21
With the new behavior, the `Width:` hint is not se
Mike West
2015/06/18 06:34:35
Got it, thank you.
| |
| 17 img.onload = t.step_func(function(){ t.done(); }); | 18 img.onload = t.step_func(function(){ t.done(); }); |
| 18 img.onerror = t.step_func(unreached); | 19 img.onerror = t.step_func(unreached); |
| 19 document.body.appendChild(img); | 20 document.body.appendChild(img); |
| 20 }; | 21 }; |
| 21 var loadViewportImage = function() { | 22 var loadViewportImage = function() { |
| 22 var img = new Image(); | 23 var img = new Image(); |
| 23 img.src = 'resources/image-checks-for-viewport-width.php'; | 24 img.src = 'resources/image-checks-for-viewport-width.php'; |
| 24 img.onload = t.step_func(loadRWImage); | 25 img.onload = t.step_func(loadRWImage); |
| 25 img.onerror = t.step_func(unreached); | 26 img.onerror = t.step_func(unreached); |
| 26 document.body.appendChild(img); | 27 document.body.appendChild(img); |
| 27 }; | 28 }; |
| 28 t.step(function() { | 29 t.step(function() { |
| 29 var img = new Image(); | 30 var img = new Image(); |
| 30 img.src = 'resources/image-checks-for-dpr.php'; | 31 img.src = 'resources/image-checks-for-dpr.php'; |
| 31 img.onload = t.step_func(loadViewportImage); | 32 img.onload = t.step_func(loadViewportImage); |
| 32 img.onerror = t.step_func(unreached); | 33 img.onerror = t.step_func(unreached); |
| 33 document.body.appendChild(img); | 34 document.body.appendChild(img); |
| 34 }); | 35 }); |
| 35 </script> | 36 </script> |
| 36 </body> | 37 </body> |
| OLD | NEW |