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

Side by Side Diff: net/http/http_cache_unittest.cc

Issue 7719007: Add a gyp flag to enable dcheck by default in release without (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | net/socket/transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include "base/hash_tables.h" 7 #include "base/hash_tables.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 4085 matching lines...) Expand 10 before | Expand all | Expand 10 after
4096 4096
4097 RunTransactionTest(cache.http_cache(), transaction); 4097 RunTransactionTest(cache.http_cache(), transaction);
4098 4098
4099 EXPECT_EQ(2, cache.network_layer()->transaction_count()); 4099 EXPECT_EQ(2, cache.network_layer()->transaction_count());
4100 EXPECT_EQ(1, cache.disk_cache()->open_count()); 4100 EXPECT_EQ(1, cache.disk_cache()->open_count());
4101 EXPECT_EQ(1, cache.disk_cache()->create_count()); 4101 EXPECT_EQ(1, cache.disk_cache()->create_count());
4102 4102
4103 RemoveMockTransaction(&transaction); 4103 RemoveMockTransaction(&transaction);
4104 } 4104 }
4105 4105
4106 #ifdef NDEBUG 4106 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
4107 // This test hits a NOTREACHED so it is a release mode only test. 4107 // This test hits a NOTREACHED so it is a release mode only test.
4108 TEST(HttpCache, RangeGET_OK_LoadOnlyFromCache) { 4108 TEST(HttpCache, RangeGET_OK_LoadOnlyFromCache) {
4109 MockHttpCache cache; 4109 MockHttpCache cache;
4110 AddMockTransaction(&kRangeGET_TransactionOK); 4110 AddMockTransaction(&kRangeGET_TransactionOK);
4111 4111
4112 // Write to the cache (40-49). 4112 // Write to the cache (40-49).
4113 RunTransactionTest(cache.http_cache(), kRangeGET_TransactionOK); 4113 RunTransactionTest(cache.http_cache(), kRangeGET_TransactionOK);
4114 EXPECT_EQ(1, cache.network_layer()->transaction_count()); 4114 EXPECT_EQ(1, cache.network_layer()->transaction_count());
4115 EXPECT_EQ(0, cache.disk_cache()->open_count()); 4115 EXPECT_EQ(0, cache.disk_cache()->open_count());
4116 EXPECT_EQ(1, cache.disk_cache()->create_count()); 4116 EXPECT_EQ(1, cache.disk_cache()->create_count());
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 new net::DiskCacheBasedSSLHostInfo("https://www.verisign.com", ssl_config, 5213 new net::DiskCacheBasedSSLHostInfo("https://www.verisign.com", ssl_config,
5214 &cert_verifier, cache.http_cache()); 5214 &cert_verifier, cache.http_cache());
5215 ssl_host_info->Start(); 5215 ssl_host_info->Start();
5216 DeleteSSLHostInfoCompletionCallback callback(ssl_host_info); 5216 DeleteSSLHostInfoCompletionCallback callback(ssl_host_info);
5217 int rv = ssl_host_info->WaitForDataReady(&callback); 5217 int rv = ssl_host_info->WaitForDataReady(&callback);
5218 EXPECT_EQ(net::ERR_IO_PENDING, rv); 5218 EXPECT_EQ(net::ERR_IO_PENDING, rv);
5219 // Now complete the backend creation and let the callback run. 5219 // Now complete the backend creation and let the callback run.
5220 factory->FinishCreation(); 5220 factory->FinishCreation();
5221 EXPECT_EQ(net::OK, callback.GetResult(rv)); 5221 EXPECT_EQ(net::OK, callback.GetResult(rv));
5222 } 5222 }
OLDNEW
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | net/socket/transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698