blob: d6abe6c8120a552817b1a28ecd43d2f188c9885e [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<body>
<script>
var t = async_test('Client-Hints not sent when Accept-CH header is not present');
var body = document.body;
var unreached = function() {
assert_unreached("Image should not have loaded.");
};
var loadDeviceMemoryImage = function() {
var img = new Image();
img.src = 'resources/image-checks-for-device-memory.php';
img.onload = t.step_func(unreached);
img.onerror = t.step_func(function(){ t.done(); });
body.appendChild(img);
};
var loadRWImage = function() {
var img = new Image();
img.src = 'resources/image-checks-for-width.php';
img.onload = t.step_func(unreached);
img.onerror = t.step_func(loadDeviceMemoryImage);
body.appendChild(img);
};
t.step(function() {
var img = new Image();
img.src = 'resources/image-checks-for-dpr.php';
img.onload = t.step_func(unreached);
img.onerror = t.step_func(loadRWImage);
body.appendChild(img);
});
</script>
</body>