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

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: Created 4 years, 4 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..9c5f52f5720bdaba1d956fc5e6cb95003b22fbc1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/loading/resources/image-picture-no-download-after-picture-removal-frame.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<body>
+<script>
+ var imgLoad = function() {
+ document.body.removeChild(document.getElementsById("pic"));
cbiesinger 2016/08/17 19:32:05 Elements -> Element
Yoav Weiss 2016/08/30 07:37:07 yeah, that test is all kinds of broken. should be
+ 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 id=pic>
+ <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