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

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: Fixed threshold after revert 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..ae615bdecdb482dc14f9198bd4010fe3a28753ac 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
@@ -1191,15 +1191,19 @@ 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| is a workaround for the run-webkit-test server. We are
+ // speculating the server quits the transaction prematurely without
+ // completing the request.
+ 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