diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 23:04:01 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 23:04:01 +0000 |
commit | 88c7b4be29f681fa8b4ed1b88129d9bf58a07f5b (patch) | |
tree | ef3765234f59175dbda60d138bd960cc7a1927d4 /net/spdy/spdy_network_transaction_unittest.cc | |
parent | 9c0c0e49a3bd98b356c195cfd0d40bc78ad9092c (diff) | |
download | chromium_src-88c7b4be29f681fa8b4ed1b88129d9bf58a07f5b.zip chromium_src-88c7b4be29f681fa8b4ed1b88129d9bf58a07f5b.tar.gz chromium_src-88c7b4be29f681fa8b4ed1b88129d9bf58a07f5b.tar.bz2 |
Fix "unreachable code" warnings (MSVC warning 4702) in net/.
BUG=346399
TEST=none
R=rvargas@chromium.org
Review URL: https://codereview.chromium.org/203013002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_network_transaction_unittest.cc')
-rw-r--r-- | net/spdy/spdy_network_transaction_unittest.cc | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index c80efe8..f488ff7 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -4280,21 +4280,16 @@ TEST_P(SpdyNetworkTransactionTest, BufferedCancelled) { // Read Data TestCompletionCallback read_callback; - do { - const int kReadSize = 256; - scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kReadSize)); - rv = trans->Read(buf.get(), kReadSize, read_callback.callback()); - if (rv == net::ERR_IO_PENDING) { - // Complete the read now, which causes buffering to start. - data.CompleteRead(); - // Destroy the transaction, causing the stream to get cancelled - // and orphaning the buffered IO task. - helper.ResetTrans(); - break; - } - // We shouldn't get here in this test. - FAIL() << "Unexpected read: " << rv; - } while (rv > 0); + const int kReadSize = 256; + scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kReadSize)); + rv = trans->Read(buf.get(), kReadSize, read_callback.callback()); + ASSERT_EQ(net::ERR_IO_PENDING, rv) << "Unexpected read: " << rv; + + // Complete the read now, which causes buffering to start. + data.CompleteRead(); + // Destroy the transaction, causing the stream to get cancelled + // and orphaning the buffered IO task. + helper.ResetTrans(); // Flush the MessageLoop; this will cause the buffered IO task // to run for the final time. |