Index: LayoutTests/http/tests/images/image-with-origin-header.html |
diff --git a/LayoutTests/http/tests/images/image-with-origin-header.html b/LayoutTests/http/tests/images/image-with-origin-header.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6cca7e4c5bf09f18d2ea09f6a37092eb5c4a505d |
--- /dev/null |
+++ b/LayoutTests/http/tests/images/image-with-origin-header.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<body> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script> |
+ description("Tests that the order of setting the src of an image element and its crossOrigin attribute doesn't matter"); |
+ jsTestIsAsync = true; |
+ |
+ var img = new Image(); |
+ img.src="http://127.0.0.1:8000/resources/origin.php?1"; |
+ img.crossOrigin = "anonymous"; |
+ var img2 = new Image(); |
+ img2.crossOrigin = "anonymous"; |
+ img2.src="http://127.0.0.1:8000/resources/origin.php?2"; |
+ |
+ var srcFirstHasOrigin = false; |
+ var srcLastHasOrigin = false; |
+ document.body.onload = function() { |
+ srcFirstHasOrigin = (img.width == 100) |
+ // srcFirstHasOrigin should be true per spec - see http://crbug.com/341047 |
+ shouldBeFalse('srcFirstHasOrigin'); |
+ srcLastHasOrigin = (img2.width == 100) |
+ shouldBeTrue('srcLastHasOrigin'); |
+ finishJSTest(); |
+ }; |
+ |
+</script> |
+</body> |
+</html> |