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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal.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/image-picture-no-download-after-removal.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal.html b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal.html
new file mode 100644
index 0000000000000000000000000000000000000000..5a6088b6b1a8aff30cd4f9c8cf0c518c4081ce30
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+ var t = async_test('Make sure that source based image resources are not downloaded after the img is removed from the DOM.');
+</script>
+<iframe id=frame src="resources/image-picture-no-download-after-removal-frame.html" width="700px"></iframe>
+<script>
+ window.addEventListener("message", t.step_func(function(msg) {
+ if (msg.data == "shrink") {
+ document.getElementsByTagName("iframe")[0].width = "150px";
+ } else if (msg.data.indexOf("test_") != -1) {
+ assert_equals(msg.data, "test_1");
+ t.done();
+ }
+ }));
+
+ // Since we want to see that a new resource wasn't downloaded, the only way is a timeout.
+ setTimeout(t.step_func(function() {
+ document.getElementById("frame").contentWindow.postMessage("test", "*");
+ }), 500);
+</script>

Powered by Google App Engine
This is Rietveld 408576698