OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta http-equiv="Accept-CH" content="DPR, RW"> | 2 <meta http-equiv="Accept-CH" content="DPR, Width, Viewport-Width"> |
3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script> | 5 <script> |
6 document.write('<img id="testimg1" src="resources/image-checks-for-rw.php?rw
=480" sizes="60vw">'); | 6 document.write('<img id="testimg1" src="resources/image-checks-for-width.php
?rw=480" sizes="60vw">'); |
7 document.write('<img id="testimg2" sizes="40vw" src="resources/image-checks-
for-rw.php?rw=320" sizes="60vw">'); | 7 document.write('<img id="testimg2" sizes="40vw" src="resources/image-checks-
for-width.php?rw=320" sizes="60vw">'); |
8 document.write('<img id="testimg3" sizes="50vw" src="resources/image-checks-
for-rw.php?rw=400">'); | 8 document.write('<img id="testimg3" sizes="50vw" src="resources/image-checks-
for-width.php?rw=400">'); |
| 9 document.write('<img id="testimg4" sizes="50vw" src="resources/image-checks-
for-viewport-width.php?viewport=800">'); |
9 var t = async_test('Client-Hints sent with the right RW value when Accept-CH
header is present'); | 10 var t = async_test('Client-Hints sent with the right RW value when Accept-CH
header is present'); |
10 window.onload = t.step_func(function() { | 11 window.onload = t.step_func(function() { |
11 assert_not_equals(document.getElementById("testimg1").naturalWidth, 0); | 12 assert_not_equals(document.getElementById("testimg1").naturalWidth, 0); |
12 assert_not_equals(document.getElementById("testimg2").naturalWidth, 0); | 13 assert_not_equals(document.getElementById("testimg2").naturalWidth, 0); |
13 assert_not_equals(document.getElementById("testimg3").naturalWidth, 0); | 14 assert_not_equals(document.getElementById("testimg3").naturalWidth, 0); |
| 15 assert_not_equals(document.getElementById("testimg4").naturalWidth, 0); |
14 t.done(); | 16 t.done(); |
15 }); | 17 }); |
16 </script> | 18 </script> |
OLD | NEW |