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

Unified Diff: LayoutTests/http/tests/loading/preload-picture-nested.html

Issue 265763010: Add preloader support for picture based source selection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modified fixmes Created 6 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: LayoutTests/http/tests/loading/preload-picture-nested.html
diff --git a/LayoutTests/http/tests/loading/preload-picture-nested.html b/LayoutTests/http/tests/loading/preload-picture-nested.html
new file mode 100644
index 0000000000000000000000000000000000000000..1b0cbc1fd6f53dac5ccfcc6a7faba86962694512
--- /dev/null
+++ b/LayoutTests/http/tests/loading/preload-picture-nested.html
@@ -0,0 +1,83 @@
+<html>
+<head>
+<script src="/js-test-resources/js-test.js"></script>
+<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script>
+<script src="resources/picture-preload-helper.js"></script>
+</head>
+<body>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ shouldBeTrue("internals.isPreloaded('resources/preload-test.jpg?0');");
+ shouldBeTrue("internals.isPreloaded('resources/image2.png');");
+ loadFromSource(1);
+ loadFromSource(2);
+ loadFromImg(3);
+ loadFromSource(4);
+ loadFromImg(5);
+ loadFromSource(6);
+ loadFromSource(7);
+ shouldBeFalse("internals.isPreloaded('resources/preload-test.jpg?71');");
+ shouldBeTrue("internals.isPreloaded('resources/preload-test.jpg?72');");
+ shouldBeTrue("internals.isPreloaded('resources/preload-test.jpg?8');");
+</script>
+<!-- Control group -->
+<img src="resources/preload-test.jpg?0">
+<picture>
+<source srcset="resources/image2.png">
+<img></picture>
+<!-- nested element tests - In these we're doing the right thing -->
+<picture>
+ <picture>
+ <source sizes="400px" srcset="resources/base-image1.png?1 200w, resources/base-image3.png?1 400w, resources/base-image2.png?1 800w">
+ <img src="resources/preload-test.jpg?1">
+ </picture>
+</picture>
+<picture>
+ <div>
+ <picture>
+ <source sizes="400px" srcset="resources/base-image1.png?2 200w, resources/base-image3.png?2 400w, resources/base-image2.png?2 800w">
+ <img src="resources/preload-test.jpg?2">
+ </picture>
+ </div>
+</picture>
+<picture>
+ <source sizes="400px" srcset="resources/base-image1.png?3 200w, resources/base-image3.png?3 400w, resources/base-image2.png?3 800w">
+ <div>
+ <picture>
+ <source sizes="400px" srcset="resources/base-image1.png?4 200w, resources/base-image3.png?4 400w, resources/base-image2.png?4 800w">
+ <!-- We're getting this one right -->
+ <img src="resources/preload-test.jpg?4">
+ </picture>
+ </div>
+ <!-- This one we're getting wrong -->
+ <img src="resources/preload-test.jpg?3">
+</picture>
+<picture>
+ <source sizes="400px" srcset="resources/base-image1.png?5 200w, resources/base-image3.png?5 400w, resources/base-image2.png?5 800w">
+ <div />
+ <picture>
+ <source sizes="400px" srcset="resources/base-image1.png?6 200w, resources/base-image3.png?6 400w, resources/base-image2.png?6 800w">
+ <!-- We're getting this one right -->
+ <img src="resources/preload-test.jpg?6">
+ </picture>
+ </div>
+ <!-- This one we're getting wrong -->
+ <img src="resources/preload-test.jpg?5">
+</picture>
+<picture>
+ <picture>
+ <source sizes="400px" srcset="resources/base-image1.png?7 200w, resources/base-image3.png?7 400w, resources/base-image2.png?7 800w">
+ <!-- We're getting these two right -->
+ <img src="resources/preload-test.jpg?7">
+ <img src="resources/preload-test.jpg?71">
+ </picture>
+ <img src="resources/preload-test.jpg?72">
+</picture>
+<picture>
+ <img src="resources/preload-test.jpg?8">
+</picture>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698