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

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: Added srcset related tests 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..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>

Powered by Google App Engine
This is Rietveld 408576698