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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/loading/resources/image-picture-no-download-after-picture-removal-frame.html

Issue 2256533002: Remove MediaQueryList listener from removed HTMLSourceElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 3 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/loading/resources/image-picture-no-download-after-picture-removal-frame.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/resources/image-picture-no-download-after-picture-removal-frame.html b/third_party/WebKit/LayoutTests/http/tests/loading/resources/image-picture-no-download-after-picture-removal-frame.html
new file mode 100644
index 0000000000000000000000000000000000000000..ecc50150055ecaa1ed0157465bfc5d49639cbc0c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/loading/resources/image-picture-no-download-after-picture-removal-frame.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<body>
+<script>
+ var imgLoad = function() {
+ var node = document.body.getElementsByTagName("picture")[0];
+ if (node) {
+ document.body.removeChild(node);
+ window.parent.postMessage("shrink", "*");
+ }
+ }
+
+ var test = function () {
+ var entries = performance.getEntriesByType("resource");
+ var downloadedImages = 0;
+ for (var i = 0; i < entries.length; ++i) {
+ var entry = entries[i];
+ if (entry.name.indexOf("base-image") != -1)
+ ++downloadedImages;
+ }
+ return downloadedImages;
+ }
+
+ window.addEventListener("message", function(msg) {
+ if (msg.data == "test")
+ window.parent.postMessage("test_" + test(), "*");
+ });
+</script>
+<picture>
+ <source id=src srcset="base-image1.png" media="(max-width: 200px)">
+ <img src="base-image2.png" onload="imgLoad()">
+</picture>
+</body>

Powered by Google App Engine
This is Rietveld 408576698