Index: chrome/test/data/extensions/api_test/webrequest/cors/load_image.html |
diff --git a/chrome/test/data/extensions/api_test/webrequest/cors/load_image.html b/chrome/test/data/extensions/api_test/webrequest/cors/load_image.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c6fa6701233dee18d9c07abacf59c20db77bfa73 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/webrequest/cors/load_image.html |
@@ -0,0 +1,24 @@ |
+<script> |
+var img = document.createElement('img'); |
+img.crossOrigin = location.search.match(/crossOrigin=(anonymous|use-credentials)/)[1]; |
+ |
+// After verifying that the image is loaded correctly, we |
+// must also check whether the renderer accepts the resource. |
+// The replies are delayed to allow tests to close the tabs in case |
+// the test failed at an early stage. |
+img.onerror = function() { |
+ setTimeout(function() { |
+ // Should not happen. Failure is signaled to allow the unit tests to continue |
+ // with the next test, the exact value of the next string does not matter. |
+ new Image().src = '/signal_that_image_failed_to_load'; |
+ }, 500); |
+}; |
+img.onload = function() { |
+ setTimeout(function() { |
+ // Verified in test_blocking.js |
+ new Image().src = '/signal_that_image_loaded_successfully'; |
+ }, 500); |
+}; |
+ |
+img.src = decodeURIComponent(location.search.match(/src=([^&]+)/)[1]); |
+</script> |