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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Issue 2766883002: Allow status = 0 when XHR is completed in Audit.loadFileFromUrl(). (Closed)
Patch Set: Fix Audit.loadAudioFileFromUrl() Created 3 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
Index: third_party/WebKit/LayoutTests/webaudio/resources/audit.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
index bd3051a570d6abe54d71d85320f02c1ddd3a5e2b..8629c15ea2070498d2db2b358ddf6a973041d168 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
@@ -1191,15 +1191,18 @@ window.Audit = (function () {
function loadFileFromUrl (fileUrl) {
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
- xhr.open('GET', fileUrl);
+ xhr.open('GET', fileUrl, true);
xhr.responseType = 'arraybuffer';
xhr.onload = () => {
- if (xhr.status === 200) {
+ // |status = 0| should be acceptable here because the server used by
+ // run-webkit-test has cross-domain file access issue.
Raymond Toy 2017/03/21 21:16:33 Do we actually know this (cross-domain)?
hongchan 2017/03/21 23:07:57 Comment fixed.
+ if (xhr.status === 200 || xhr.status === 0) {
resolve(xhr.response);
} else {
let errorMessage = 'loadFile: Request failed when loading ' +
- fileUrl + '. (' + xhr.statusText + ')';
+ fileUrl + '. ' + xhr.statusText + '. (status = ' +
+ xhr.status + ')';
if (reject) {
reject(errorMessage);
} else {

Powered by Google App Engine
This is Rietveld 408576698