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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php

Issue 2860093003: Implement device-ram client hints header (Closed)
Patch Set: Rebase UseCounter.h Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php b/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php
index de7c0183c074ec60042d56c69d30f0d0e09c4137..f36e2cca5dc77c08fecc50e0ad75897c7e52c5da 100644
--- a/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-accept-ch.php
@@ -1,5 +1,5 @@
<?php
- header("ACCEPT-CH: DPR, Width, Viewport-Width");
+ header("ACCEPT-CH: DPR, Width, Viewport-Width, Device-RAM");
?>
<!DOCTYPE html>
<body>
@@ -14,11 +14,18 @@
parent.postMessage("success", "*");
};
+ var loadDeviceRAMImage = function() {
+ var img = new Image();
+ img.src = 'image-checks-for-device-ram.php';
+ img.onload = success;
+ img.onerror = fail(4);
+ document.body.appendChild(img);
+ };
var loadRWImage = function() {
var img = new Image();
img.src = 'image-checks-for-width.php';
img.sizes = '500';
- img.onload = success
+ img.onload = loadDeviceRAMImage;
img.onerror = fail(3);
document.body.appendChild(img);
};

Powered by Google App Engine
This is Rietveld 408576698