Bug 1415797 - Fix failures in dom/network/tests/ with comformant Promise handling. r=smaug
authorBevis Tseng <btseng@mozilla.com>
Wed, 13 Dec 2017 14:14:23 -0600
changeset 396356 a0dce3b206fa8648ba301bd707638cc9d66d59ad
parent 396355 c5894798a3a00122fa93c15c044116947861f4f4
child 396357 ee9086cff857aa45e0b65b5952f28705ef54e905
push id33087
push userdluca@mozilla.com
push dateThu, 14 Dec 2017 09:54:55 +0000
treeherdermozilla-central@8062887ff0d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1415797
milestone59.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 1415797 - Fix failures in dom/network/tests/ with comformant Promise handling. r=smaug
dom/network/TCPSocket.cpp
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -1009,20 +1009,20 @@ NS_IMETHODIMP
 TCPSocket::OnTransportStatus(nsITransport* aTransport, nsresult aStatus,
                              int64_t aProgress, int64_t aProgressMax)
 {
   if (static_cast<uint32_t>(aStatus) != nsISocketTransport::STATUS_CONNECTED_TO) {
     return NS_OK;
   }
 
   mReadyState = TCPReadyState::Open;
+  nsresult rv = CreateInputStreamPump();
+  NS_ENSURE_SUCCESS(rv, rv);
   FireEvent(NS_LITERAL_STRING("open"));
 
-  nsresult rv = CreateInputStreamPump();
-  NS_ENSURE_SUCCESS(rv, rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TCPSocket::OnInputStreamReady(nsIAsyncInputStream* aStream)
 {
   // Only used for detecting if the connection was refused.