Bug 1599957 - Fix intermittent test WebExecutorTest.testFetchStreamError r=snorp
authorBrendan Dahl <bdahl@mozilla.com>
Thu, 12 Dec 2019 15:29:36 +0000
changeset 506734 430eaef2810af45a36437857a9bcfed4a9893414
parent 506733 03ca0b24c449d83a116f65dc48f27605456f53c5
child 506735 d51e89699f8f39061532b2833ff93686a725bc47
push id103036
push userbdahl@mozilla.com
push dateThu, 12 Dec 2019 17:17:56 +0000
treeherderautoland@430eaef2810a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1599957
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1599957 - Fix intermittent test WebExecutorTest.testFetchStreamError r=snorp Currently, it's possible for testFetchStreamError to finish receiving data before the error is received and throws. Differential Revision: https://phabricator.services.mozilla.com/D56797
widget/android/WebExecutorSupport.cpp
--- a/widget/android/WebExecutorSupport.cpp
+++ b/widget/android/WebExecutorSupport.cpp
@@ -214,17 +214,17 @@ class LoaderListener final : public nsIS
   }
 
   NS_IMETHOD
   OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInputStream,
                   uint64_t aOffset, uint32_t aCount) override {
     MOZ_ASSERT(mStream);
 
     if (mTestStreamFailure) {
-      aRequest->Cancel(NS_ERROR_ABORT);
+      return NS_ERROR_UNEXPECTED;
     }
 
     // We only need this for the ReadSegments call, the value is unused.
     uint32_t countRead;
     return aInputStream->ReadSegments(WriteSegment, this, aCount, &countRead);
   }
 
   NS_IMETHOD