Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/client-hint-accept-on-subresource.html

Issue 2860093003: Implement device-ram client hints header (Closed)
Patch Set: Rebase UseCounter.h Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept.php » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <body> 4 <body>
5 <!-- The following script's response contains an Accept-CH header, and there fore must be synchronous 5 <!-- The following script's response contains an Accept-CH header, and there fore must be synchronous
6 for the purpose of this test --> 6 for the purpose of this test -->
7 <script src="../resources/accept-ch.php"></script> 7 <script src="../resources/accept-ch.php"></script>
8 <script> 8 <script>
9 var t = async_test('Client-Hints not sent when Accept-CH header is prese nt only in subresource'); 9 var t = async_test('Client-Hints not sent when Accept-CH header is prese nt only in subresource');
10 var body = document.body; 10 var body = document.body;
11 var unreached = function() { 11 var unreached = function() {
12 assert_unreached("Image should not have loaded."); 12 assert_unreached("Image should not have loaded.");
13 }; 13 };
14 14
15 var loadDeviceRAMImage = function() {
16 var img = new Image();
17 img.src = 'resources/image-checks-for-device-ram.php';
18 img.onload = t.step_func(unreached);
19 img.onerror = t.step_func(function(){ t.done(); });
20 body.appendChild(img);
21 };
15 var loadRWImage = function() { 22 var loadRWImage = function() {
16 var img = new Image(); 23 var img = new Image();
17 img.src = 'resources/image-checks-for-width.php'; 24 img.src = 'resources/image-checks-for-width.php';
18 img.onload = t.step_func(unreached); 25 img.onload = t.step_func(unreached);
19 img.onerror = t.step_func(function(){ t.done(); }); 26 img.onerror = t.step_func(loadDeviceRAMImage);
20 body.appendChild(img); 27 body.appendChild(img);
21 }; 28 };
22 t.step(function() { 29 t.step(function() {
23 var img = new Image(); 30 var img = new Image();
24 img.src = 'resources/image-checks-for-dpr.php'; 31 img.src = 'resources/image-checks-for-dpr.php';
25 img.onload = t.step_func(unreached); 32 img.onload = t.step_func(unreached);
26 img.onerror = t.step_func(loadRWImage); 33 img.onerror = t.step_func(loadRWImage);
27 body.appendChild(img); 34 body.appendChild(img);
28 }); 35 });
29 </script> 36 </script>
30 </body> 37 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/misc/client-hints-accept.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698