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

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

Issue 136693020: Add image loading spec related tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed expectation for origin header test Created 6 years, 10 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: 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>

Powered by Google App Engine
This is Rietveld 408576698