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

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

Issue 14263005: Refactor our SimpleIndex file format and serialization to use Pickle instead of the previously bugg… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: to commit again, since the last dcommit failed Created 7 years, 8 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 | « no previous file | net/disk_cache/simple/simple_disk_format.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/port.h" 7 #include "base/port.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
11 #include "base/threading/platform_thread.h" 11 #include "base/threading/platform_thread.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/base/test_completion_callback.h" 15 #include "net/base/test_completion_callback.h"
16 #include "net/disk_cache/backend_impl.h" 16 #include "net/disk_cache/backend_impl.h"
17 #include "net/disk_cache/cache_util.h" 17 #include "net/disk_cache/cache_util.h"
18 #include "net/disk_cache/disk_cache_test_base.h" 18 #include "net/disk_cache/disk_cache_test_base.h"
19 #include "net/disk_cache/disk_cache_test_util.h" 19 #include "net/disk_cache/disk_cache_test_util.h"
20 #include "net/disk_cache/entry_impl.h" 20 #include "net/disk_cache/entry_impl.h"
21 #include "net/disk_cache/histogram_macros.h" 21 #include "net/disk_cache/histogram_macros.h"
22 #include "net/disk_cache/mapped_file.h" 22 #include "net/disk_cache/mapped_file.h"
23 #include "net/disk_cache/mem_backend_impl.h" 23 #include "net/disk_cache/mem_backend_impl.h"
24 #include "net/disk_cache/simple/simple_disk_format.h" 24 #include "net/disk_cache/simple/simple_entry_format.h"
25 #include "net/disk_cache/simple/simple_util.h" 25 #include "net/disk_cache/simple/simple_util.h"
26 #include "net/disk_cache/tracing_cache_backend.h" 26 #include "net/disk_cache/tracing_cache_backend.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 28
29 #if defined(OS_WIN) 29 #if defined(OS_WIN)
30 #include "base/win/scoped_handle.h" 30 #include "base/win/scoped_handle.h"
31 #endif 31 #endif
32 32
33 using base::Time; 33 using base::Time;
34 34
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 disk_cache::SimpleFileHeader header; 2765 disk_cache::SimpleFileHeader header;
2766 header.initial_magic_number = GG_UINT64_C(0xbadf00d); 2766 header.initial_magic_number = GG_UINT64_C(0xbadf00d);
2767 EXPECT_EQ( 2767 EXPECT_EQ(
2768 implicit_cast<int>(sizeof(header)), 2768 implicit_cast<int>(sizeof(header)),
2769 file_util::WriteFile(entry_file1_path, reinterpret_cast<char*>(&header), 2769 file_util::WriteFile(entry_file1_path, reinterpret_cast<char*>(&header),
2770 sizeof(header))); 2770 sizeof(header)));
2771 ASSERT_EQ(net::ERR_FAILED, OpenEntry(key, &entry)); 2771 ASSERT_EQ(net::ERR_FAILED, OpenEntry(key, &entry));
2772 } 2772 }
2773 2773
2774 #endif // !defined(OS_WIN) 2774 #endif // !defined(OS_WIN)
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_disk_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698