Cronet: Fix CronetUploadTest.testDestroyAdapterBefore* tests.
commitea69e72231b085781569d037bd61a583d16a5912
authormmenke <mmenke@chromium.org>
Fri, 24 Apr 2015 19:06:49 +0000 (24 12:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 24 Apr 2015 19:06:54 +0000 (24 19:06 +0000)
treed6d32311303480f60414c2154ff7d81b853bb95b
parentb3ca230ddd7d1238ee96ed26ea23e369f10dd655
Cronet:  Fix CronetUploadTest.testDestroyAdapterBefore* tests.

The tests weren't actually destroying the adapter when they claimed.
As a result, the final read/rewind call could happen on the "network"
thread between starting the destroy task in Shutdown and actually
tearing down the network thread, at which point the
TestUploadDataStreamHandler network thread pointer is NULL, resulting in
a crash.

The fix is just to destroy the adapters when they should be, at which
point there should be no messages pending on the network thread.  May be
worth revising how thread checks are done if more tests are added.

BUG=480623

Review URL: https://codereview.chromium.org/1098253005

Cr-Commit-Position: refs/heads/master@{#326852}
components/cronet/android/test/javatests/src/org/chromium/net/CronetUploadTest.java
components/cronet/android/test/src/org/chromium/net/TestUploadDataStreamHandler.java