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

Side by Side Diff: net/disk_cache/backend_unittest.cc

Issue 6613027: Adds memory cache logging, and updates disk cache logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Oops Created 9 years, 9 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 | « net/disk_cache/backend_impl.cc ('k') | net/disk_cache/disk_cache_test_base.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 // Test the private factory methods. 200 // Test the private factory methods.
201 disk_cache::Backend* cache = NULL; 201 disk_cache::Backend* cache = NULL;
202 int rv = disk_cache::BackendImpl::CreateBackend( 202 int rv = disk_cache::BackendImpl::CreateBackend(
203 path, false, 0, net::DISK_CACHE, disk_cache::kNoRandom, 203 path, false, 0, net::DISK_CACHE, disk_cache::kNoRandom,
204 cache_thread.message_loop_proxy(), NULL, &cache, &cb); 204 cache_thread.message_loop_proxy(), NULL, &cache, &cb);
205 ASSERT_EQ(net::OK, cb.GetResult(rv)); 205 ASSERT_EQ(net::OK, cb.GetResult(rv));
206 ASSERT_TRUE(cache); 206 ASSERT_TRUE(cache);
207 delete cache; 207 delete cache;
208 208
209 cache = disk_cache::MemBackendImpl::CreateBackend(0); 209 cache = disk_cache::MemBackendImpl::CreateBackend(0, NULL);
210 ASSERT_TRUE(cache); 210 ASSERT_TRUE(cache);
211 delete cache; 211 delete cache;
212 cache = NULL; 212 cache = NULL;
213 213
214 // Now test the public API. 214 // Now test the public API.
215 rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, path, 0, false, 215 rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, path, 0, false,
216 cache_thread.message_loop_proxy(), 216 cache_thread.message_loop_proxy(),
217 NULL, &cache, &cb); 217 NULL, &cache, &cb);
218 ASSERT_EQ(net::OK, cb.GetResult(rv)); 218 ASSERT_EQ(net::OK, cb.GetResult(rv));
219 ASSERT_TRUE(cache); 219 ASSERT_TRUE(cache);
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 char buffer1[kSize]; 2079 char buffer1[kSize];
2080 char buffer2[kSize]; 2080 char buffer2[kSize];
2081 memset(buffer1, 't', kSize); 2081 memset(buffer1, 't', kSize);
2082 memset(buffer2, 0, kSize); 2082 memset(buffer2, 0, kSize);
2083 EXPECT_TRUE(file->Write(buffer1, kSize, 0)); 2083 EXPECT_TRUE(file->Write(buffer1, kSize, 0));
2084 EXPECT_TRUE(file->Read(buffer2, kSize, 0)); 2084 EXPECT_TRUE(file->Read(buffer2, kSize, 0));
2085 EXPECT_EQ(0, memcmp(buffer1, buffer2, kSize)); 2085 EXPECT_EQ(0, memcmp(buffer1, buffer2, kSize));
2086 2086
2087 EXPECT_TRUE(disk_cache::DeleteCacheFile(name)); 2087 EXPECT_TRUE(disk_cache::DeleteCacheFile(name));
2088 } 2088 }
OLDNEW
« no previous file with comments | « net/disk_cache/backend_impl.cc ('k') | net/disk_cache/disk_cache_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698