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

Unified Diff: LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin.html

Issue 984213002: CORS errors print error twice on preload. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added delay to cors-script.php Created 5 years, 9 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 | LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin.html
diff --git a/LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin.html b/LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin.html
new file mode 100644
index 0000000000000000000000000000000000000000..e401ca7f2c2bd190d107a1e1c6663f4ae1185fe7
--- /dev/null
+++ b/LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- Regression test for https://crbug.com/464876. On a CORS failure, multiple
+ error messages should not be logged, even if preload occurs. -->
+<head>
+</head>
+
+<script src="/js-test-resources/js-test.js"></script>
+
+<script>
+ window.jsTestIsAsync = true;
+ description('Preload of script with CORS failure only shows one error');
+
+var result = "PASS";
+
+var scriptLoad = function() {
+ testFailed('Script loaded.');
+};
+
+var scriptError = function() {
+ if (result === 'PASS')
+ testPassed('Script error.');
+ else
+ testFailed('Script ran.');
+ finishJSTest();
+};
+
+var checkForPreload = function(url) {
+ if (internals.isPreloaded(url))
+ testPassed("Did preload.");
+};
+</script>
+
+<!-- Force a preload -->
+<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script>
+<script>
+checkForPreload("http://localhost:8000/security/resources/cors-script.php?delay=100&cors=false&value=FAIL");
+</script>
+<script crossorigin="anonymous" src="http://localhost:8000/security/resources/cors-script.php?delay=100&cors=false&value=FAIL" onload="scriptLoad()" onerror="scriptError();"></script>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698