Index: LayoutTests/http/tests/misc/client-hints-no-accept.html |
diff --git a/LayoutTests/http/tests/misc/client-hints-no-accept.html b/LayoutTests/http/tests/misc/client-hints-no-accept.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..322f02f473e9803953fddadc1fbf020dfa40ef16 |
--- /dev/null |
+++ b/LayoutTests/http/tests/misc/client-hints-no-accept.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE html> |
+<script src="/w3c/resources/testharness.js"></script> |
+<script src="/w3c/resources/testharnessreport.js"></script> |
+<body> |
+ <script> |
+ var t = async_test('Client-Hints not sent when Aceept-CH header is not present'); |
Mike West
2015/02/25 11:37:11
Nit: s/Aceept/Accept/
|
+ var body = document.body; |
+ var unreached = function() { |
+ assert_unreached("Image should not have loaded."); |
+ }; |
+ |
+ var loadRWImage = function() { |
+ var img = new Image(); |
+ img.src = 'resources/image-checks-for-rw.php'; |
+ img.onload = t.step_func(unreached); |
+ img.onerror = t.step_func(function(){ t.done(); }); |
+ body.appendChild(img); |
+ }; |
+ t.step(function() { |
+ var img = new Image(); |
+ img.src = 'resources/image-checks-for-dpr.php'; |
Mike West
2015/02/25 11:37:11
Doesn't assigning to `.src` trigger a load right a
|
+ img.onload = t.step_func(unreached); |
+ img.onerror = t.step_func(loadRWImage); |
+ body.appendChild(img); |
+ }); |
+ </script> |
+</body> |