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

Unified Diff: net/http/http_cache_unittest.cc

Issue 16480002: Fix some potential after free errors on TestCompletionCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to review 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
« no previous file with comments | « net/cert/multi_threaded_cert_verifier_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_cache_unittest.cc
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 14099c7bd684e61e34939fb62804de3aaf73c0ed..b2079780d7b4bc47ca9271d8d79494590938f5f4 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -5935,17 +5935,22 @@ TEST(HttpCache, SetPriority) {
EXPECT_EQ(net::ERR_IO_PENDING,
trans->Start(&info, callback.callback(), net::BoundNetLog()));
- ASSERT_TRUE(cache.network_layer()->last_transaction());
- EXPECT_EQ(net::LOW,
- cache.network_layer()->last_create_transaction_priority());
- EXPECT_EQ(net::LOW,
- cache.network_layer()->last_transaction()->priority());
+ EXPECT_TRUE(cache.network_layer()->last_transaction());
+ if (cache.network_layer()->last_transaction()) {
+ EXPECT_EQ(net::LOW,
+ cache.network_layer()->last_create_transaction_priority());
+ EXPECT_EQ(net::LOW,
+ cache.network_layer()->last_transaction()->priority());
+ }
trans->SetPriority(net::HIGHEST);
- EXPECT_EQ(net::LOW,
- cache.network_layer()->last_create_transaction_priority());
- EXPECT_EQ(net::HIGHEST,
- cache.network_layer()->last_transaction()->priority());
+
+ if (cache.network_layer()->last_transaction()) {
+ EXPECT_EQ(net::LOW,
+ cache.network_layer()->last_create_transaction_priority());
+ EXPECT_EQ(net::HIGHEST,
+ cache.network_layer()->last_transaction()->priority());
+ }
EXPECT_EQ(net::OK, callback.WaitForResult());
}
« no previous file with comments | « net/cert/multi_threaded_cert_verifier_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698