Chromium Code Reviews| Index: net/spdy/spdy_network_transaction_unittest.cc |
| =================================================================== |
| --- net/spdy/spdy_network_transaction_unittest.cc (revision 256983) |
| +++ net/spdy/spdy_network_transaction_unittest.cc (working copy) |
| @@ -4225,21 +4225,18 @@ |
| // 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; |
| - } |
| + 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) { |
| // We shouldn't get here in this test. |
| FAIL() << "Unexpected read: " << rv; |
|
rvargas (doing something else)
2014/03/19 22:13:15
This just logs a message (and keeps track of the f
Peter Kasting
2014/03/19 22:17:09
Wrong. FAIL() returns from the function. You're
rvargas (doing something else)
2014/03/19 22:56:24
OK then. I still don't see the unreachable line in
Peter Kasting
2014/03/19 23:03:24
MSVC complains that the "while (rv > 0)" is an unr
|
| - } while (rv > 0); |
| + } |
| + // Complete the read now, which causes buffering to start. |
| + data.CompleteRead(); |
|
rvargas (doing something else)
2014/03/19 22:13:15
This could end up being called when rv is not pend
Peter Kasting
2014/03/19 22:17:09
No, it can't; see my reply above.
|
| + // 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. |