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..a497e261cd23af026b0826d3ac204e27d07093f8 |
--- /dev/null |
+++ b/LayoutTests/http/tests/images/image-with-origin-header.html |
@@ -0,0 +1,27 @@ |
+<!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) |
+ shouldBeTrue('srcFirstHasOrigin'); |
+ srcLastHasOrigin = (img2.width == 100) |
+ shouldBeTrue('srcLastHasOrigin'); |
+ finishJSTest(); |
+ }; |
+ |
+</script> |
+</body> |
+</html> |