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

Unified Diff: LayoutTests/http/tests/misc/client-hints-preload-rw-sizes.html

Issue 1078633003: Added preloader support for sizes based RW values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/resources/image-checks-for-rw.php » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/misc/client-hints-preload-rw-sizes.html
diff --git a/LayoutTests/http/tests/misc/client-hints-preload-rw-sizes.html b/LayoutTests/http/tests/misc/client-hints-preload-rw-sizes.html
new file mode 100644
index 0000000000000000000000000000000000000000..fdd70821515f37678548bb3f1cde8dfaa0b3b1b7
--- /dev/null
+++ b/LayoutTests/http/tests/misc/client-hints-preload-rw-sizes.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<meta http-equiv="Accept-CH" content="DPR, RW">
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/slow-script.pl?delay=300"></script>
+<img id="testimg1" src="resources/image-checks-for-rw.php?rw=480" sizes="60vw">
+<img id="testimg2" sizes="40vw" src="resources/image-checks-for-rw.php?rw=320" sizes="60vw">
+<img id="testimg3" sizes="50vw" src="resources/image-checks-for-rw.php?rw=400">
+<script>
+ var t = async_test('Client-Hints sent with the right RW value Accept-CH header is present');
+ window.onload = t.step_func(function() {
+ assert_not_equals(document.getElementById("testimg1").naturalWidth, 0);
+ assert_not_equals(document.getElementById("testimg2").naturalWidth, 0);
+ assert_not_equals(document.getElementById("testimg3").naturalWidth, 0);
+ t.done();
+ });
+</script>
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/resources/image-checks-for-rw.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698