OLD | NEW |
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/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "net/disk_cache/blockfile/file_block.h" |
| 9 #include "net/disk_cache/blockfile/mapped_file.h" |
8 #include "net/disk_cache/disk_cache_test_base.h" | 10 #include "net/disk_cache/disk_cache_test_base.h" |
9 #include "net/disk_cache/disk_cache_test_util.h" | 11 #include "net/disk_cache/disk_cache_test_util.h" |
10 #include "net/disk_cache/file_block.h" | |
11 #include "net/disk_cache/mapped_file.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Implementation of FileIOCallback for the tests. | 16 // Implementation of FileIOCallback for the tests. |
17 class FileCallbackTest: public disk_cache::FileIOCallback { | 17 class FileCallbackTest: public disk_cache::FileIOCallback { |
18 public: | 18 public: |
19 FileCallbackTest(int id, MessageLoopHelper* helper, int* max_id) | 19 FileCallbackTest(int id, MessageLoopHelper* helper, int* max_id) |
20 : id_(id), | 20 : id_(id), |
21 helper_(helper), | 21 helper_(helper), |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (!completed) | 132 if (!completed) |
133 expected++; | 133 expected++; |
134 | 134 |
135 helper.WaitUntilCacheIoFinished(expected); | 135 helper.WaitUntilCacheIoFinished(expected); |
136 | 136 |
137 EXPECT_EQ(expected, helper.callbacks_called()); | 137 EXPECT_EQ(expected, helper.callbacks_called()); |
138 EXPECT_FALSE(helper.callback_reused_error()); | 138 EXPECT_FALSE(helper.callback_reused_error()); |
139 EXPECT_STREQ(static_cast<char*>(file_block1.buffer()), | 139 EXPECT_STREQ(static_cast<char*>(file_block1.buffer()), |
140 static_cast<char*>(file_block2.buffer())); | 140 static_cast<char*>(file_block2.buffer())); |
141 } | 141 } |
OLD | NEW |