Chromium Code Reviews| 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 { |