Expand test coverage for disconnect during connect.

Before this CL, URLConnectionTest.testDisconnectDuringConnect()
tested the case of a HttpURLConnection being disconnected from
the CookieManager while connecting via getInputStream(). The
test missed the bug from http://r.android.com/329002 because
that bug only occurred during getOutputStream(), which was not
tested.

After this CL, connection initiation via the follow methods is
now covered:

 - getInputStream()
 - getOutputStream()
 - getResponseCode()
 - getResponseMessage()

Note that getErrorStream() is not used because it is documented
not to initiate a connection.

Bug: 34695782
Test: libcore.java.net.URLConnectionTest
Test: Checked that testDisconnectDuringConnect_getInputStream()
      would have found the bug in http://r.android.com/329002
      (unsubmitted) because it hangs indefinitely when run against
      a build that includes that CL.

Change-Id: I6432a69b2cdac177f01e1ba84f32b99322e7c4e1
1 file changed