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

Side by Side Diff: LayoutTests/http/tests/images/image-with-origin-header.html

Issue 200923002: Post a microtask to load <img> elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix last test failure 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="/js-test-resources/js-test.js"></script> 3 <script src="/js-test-resources/js-test.js"></script>
4 <script> 4 <script>
5 description("Tests that the order of setting the src of an image element and its crossOrigin attribute doesn't matter"); 5 description("Tests that the order of setting the src of an image element and its crossOrigin attribute doesn't matter");
6 jsTestIsAsync = true; 6 jsTestIsAsync = true;
7 7
8 var img = new Image(); 8 var img = new Image();
9 img.src="http://127.0.0.1:8000/resources/origin.php?1"; 9 img.src="http://127.0.0.1:8000/resources/origin.php?1";
10 img.crossOrigin = "anonymous"; 10 img.crossOrigin = "anonymous";
11 var img2 = new Image(); 11 var img2 = new Image();
12 img2.crossOrigin = "anonymous"; 12 img2.crossOrigin = "anonymous";
13 img2.src="http://127.0.0.1:8000/resources/origin.php?2"; 13 img2.src="http://127.0.0.1:8000/resources/origin.php?2";
14 14
15 var srcFirstHasOrigin = false; 15 var srcFirstHasOrigin = false;
16 var srcLastHasOrigin = false; 16 var srcLastHasOrigin = false;
17 document.body.onload = function() { 17 document.body.onload = function() {
18 srcFirstHasOrigin = (img.width == 100) 18 srcFirstHasOrigin = (img.width == 100)
19 // srcFirstHasOrigin should be true per spec - see http://crbug.com/3410 47 19 shouldBeTrue('srcFirstHasOrigin');
20 shouldBeFalse('srcFirstHasOrigin');
21 srcLastHasOrigin = (img2.width == 100) 20 srcLastHasOrigin = (img2.width == 100)
22 shouldBeTrue('srcLastHasOrigin'); 21 shouldBeTrue('srcLastHasOrigin');
23 finishJSTest(); 22 finishJSTest();
24 }; 23 };
25 24
26 </script> 25 </script>
27 </body> 26 </body>
28 </html> 27 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698