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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-ch-with-picture-removal.php

Issue 1644503002: Fix an outdated picture removal test and comment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php 1 <?php
2 header("ACCEPT-CH: DPR, Width, Viewport-Width"); 2 header("ACCEPT-CH: DPR, Width, Viewport-Width");
3 ?> 3 ?>
4 <!DOCTYPE html> 4 <!DOCTYPE html>
5 <body> 5 <body>
6 <script> 6 <script>
7 window.addEventListener("message", function (message) { 7 window.addEventListener("message", function (message) {
8 var pic = document.getElementById("pic"); 8 var pic = document.getElementById("pic");
9 pic.removeChild(pic.childNodes[0]); 9 pic.removeChild(document.getElementById("firstsource"));
10 // TODO(yoav): this should trigger a load, but doesn't. See https://crbu g.com/418903 10 setTimeout(function(){fail(4);}, 200);
11 success();
12 }); 11 });
13 12
14 var fail = function(num) { 13 var fail = function(num) {
15 parent.postMessage("fail "+ num, "*"); 14 parent.postMessage("fail "+ num, "*");
16 }; 15 };
17 16
18 var success = function() { 17 var success = function() {
19 parent.postMessage("success", "*"); 18 parent.postMessage("success", "*");
20 }; 19 };
21 20
22 var remove = function() { 21 var remove = function() {
23 parent.postMessage("remove", "*"); 22 parent.postMessage("remove", "*");
24 }; 23 };
25 24
26 var counter = 1; 25 var counter = 1;
27 var error = function() { 26 var error = function() {
28 fail(counter); 27 fail(counter);
29 } 28 }
30 var load = function() { 29 var load = function() {
31 if (counter == 1) { 30 if (counter == 1) {
32 ++counter; 31 ++counter;
33 remove(); 32 remove();
34 return; 33 return;
35 } 34 }
36 success(); 35 success();
37 } 36 }
38 </script> 37 </script>
39 <picture id=pic> 38 <picture id=pic>
40 <source sizes="50vw" media="(min-width: 800px)" srcset="image-checks-for-wid th.php?rw=400"> 39 <source sizes="50vw" id="firstsource" media="(min-width: 800px)" srcset="ima ge-checks-for-width.php?rw=400">
41 <source sizes="50vw" srcset="image-checks-for-width.php?rw=300"> 40 <source sizes="40vw" srcset="image-checks-for-width.php?rw=320">
42 <img onerror="error()" onload="load()"> 41 <img onerror="error()" onload="load()">
43 </picture> 42 </picture>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698