Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: net/http/http_network_transaction_spdy2_unittest.cc

Issue 16480002: Fix some potential after free errors on TestCompletionCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another one Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/http/http_cache_unittest.cc ('K') | « net/http/http_cache_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_spdy2_unittest.cc
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc
index 54f1a43bd746bb3452d94e0e2cb8b10e2bf57c5a..5af035f6516835da9ce8ee6f7ca13a75cc5fb85b 100644
--- a/net/http/http_network_transaction_spdy2_unittest.cc
+++ b/net/http/http_network_transaction_spdy2_unittest.cc
@@ -309,10 +309,10 @@ class HttpNetworkTransactionSpdy2Test : public PlatformTest {
TestCompletionCallback callback;
EXPECT_TRUE(log.bound().IsLoggingAllEvents());
- int rv = trans->Start(&request, callback.callback(), log.bound());
- EXPECT_EQ(ERR_IO_PENDING, rv);
-
- out.rv = callback.WaitForResult();
+ out.rv = trans->Start(&request, callback.callback(), log.bound());
+ EXPECT_EQ(ERR_IO_PENDING, out.rv);
+ if (out.rv == net::ERR_IO_PENDING)
+ out.rv = callback.WaitForResult();
// Even in the failure cases that use this function, connections are always
// successfully established before the error.
@@ -334,7 +334,7 @@ class HttpNetworkTransactionSpdy2Test : public PlatformTest {
EXPECT_EQ("127.0.0.1", response->socket_address.host());
EXPECT_EQ(80, response->socket_address.port());
- rv = ReadTransaction(trans.get(), &out.response_data);
+ int rv = ReadTransaction(trans.get(), &out.response_data);
EXPECT_EQ(OK, rv);
net::CapturingNetLog::CapturedEntryList entries;
« net/http/http_cache_unittest.cc ('K') | « net/http/http_cache_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698