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

Unified Diff: chrome/test/data/extensions/api_test/webrequest/cors/load_image.html

Issue 348253002: Add CORS headers to URLRequestRedirectJob. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT GURL -> std::string Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/cors/redirect_target.gif » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/cors/redirect_target.gif » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698