diff --git a/dom/base/test/test_bug435425.html b/dom/base/test/test_bug435425.html
index 828931d67d17..f6cfe7e838fa 100644
--- a/dom/base/test/test_bug435425.html
+++ b/dom/base/test/test_bug435425.html
@@ -218,6 +218,8 @@ var tests =
{ method: "GET", withUpload: none, testAbort: true, testRedirectError: false, testNetworkError: false,
expectedEvents: [{target: XHR, type: "loadstart", optional: false},
{target: XHR, type: "progress", optional: true},
+ {target: UPLOAD, type: "abort", optional: false},
+ {target: UPLOAD, type: "loadend", optional: false},
{target: XHR, type: "abort", optional: false},
{target: XHR, type: "loadend", optional: false}]},
{ method: "GET", withUpload: none, testAbort: false, testRedirectError: true, testNetworkError: false,
@@ -237,6 +239,8 @@ var tests =
{ method: "GET", withUpload: small, testAbort: true, testRedirectError: false, testNetworkError: false,
expectedEvents: [{target: XHR, type: "loadstart", optional: false},
{target: XHR, type: "progress", optional: true},
+ {target: UPLOAD, type: "abort", optional: false},
+ {target: UPLOAD, type: "loadend", optional: false},
{target: XHR, type: "abort", optional: false},
{target: XHR, type: "loadend", optional: false}]},
{ method: "GET", withUpload: small, testAbort: false, testRedirectError: true, testNetworkError: false,
@@ -256,6 +260,8 @@ var tests =
{ method: "GET", withUpload: mid, testAbort: true, testRedirectError: false, testNetworkError: false,
expectedEvents: [{target: XHR, type: "loadstart", optional: false},
{target: XHR, type: "progress", optional: true},
+ {target: UPLOAD, type: "abort", optional: false},
+ {target: UPLOAD, type: "loadend", optional: false},
{target: XHR, type: "abort", optional: false},
{target: XHR, type: "loadend", optional: false}]},
{ method: "GET", withUpload: mid, testAbort: false, testRedirectError: true, testNetworkError: false,
@@ -275,6 +281,8 @@ var tests =
{ method: "GET", withUpload: large, testAbort: true, testRedirectError: false, testNetworkError: false,
expectedEvents: [{target: XHR, type: "loadstart", optional: false},
{target: XHR, type: "progress", optional: true},
+ {target: UPLOAD, type: "abort", optional: false},
+ {target: UPLOAD, type: "loadend", optional: false},
{target: XHR, type: "abort", optional: false},
{target: XHR, type: "loadend", optional: false}]},
{ method: "GET", withUpload: large, testAbort: false, testRedirectError: true, testNetworkError: false,
@@ -294,6 +302,8 @@ var tests =
{ method: "POST", withUpload: none, testAbort: true, testRedirectError: false, testNetworkError: false,
expectedEvents: [{target: XHR, type: "loadstart", optional: false},
{target: XHR, type: "progress", optional: true},
+ {target: UPLOAD, type: "abort", optional: false},
+ {target: UPLOAD, type: "loadend", optional: false},
{target: XHR, type: "abort", optional: false},
{target: XHR, type: "loadend", optional: false}]},
{ method: "POST", withUpload: none, testAbort: false, testRedirectError: true, testNetworkError: false,
diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp
index fddb4aab6ddc..239a84adc39b 100644
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -1106,10 +1106,12 @@ XMLHttpRequestMainThread::RequestErrorSteps(const ProgressEventType aEventType,
FireReadystatechangeEvent();
// Step 6
- if (mUpload && !mUploadComplete) {
+ if (mUpload) {
// Step 6-1
- mUploadComplete = true;
+ if (!mUploadComplete) {
+ mUploadComplete = true;
+ }
// Step 6-2
if (mFlagHadUploadListenersOnSend) {