OLD | NEW |
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 "webkit/browser/fileapi/sandbox_database_test_helper.h" | 5 #include "webkit/browser/fileapi/sandbox_database_test_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "webkit/fileapi/file_system_util.h" | 14 #include "webkit/common/fileapi/file_system_util.h" |
15 | 15 |
16 namespace fileapi { | 16 namespace fileapi { |
17 | 17 |
18 void CorruptDatabase(const base::FilePath& db_path, | 18 void CorruptDatabase(const base::FilePath& db_path, |
19 leveldb::FileType type, | 19 leveldb::FileType type, |
20 ptrdiff_t offset, | 20 ptrdiff_t offset, |
21 size_t size) { | 21 size_t size) { |
22 file_util::FileEnumerator file_enum(db_path, false /* not recursive */, | 22 file_util::FileEnumerator file_enum(db_path, false /* not recursive */, |
23 file_util::FileEnumerator::DIRECTORIES | | 23 file_util::FileEnumerator::DIRECTORIES | |
24 file_util::FileEnumerator::FILES); | 24 file_util::FileEnumerator::FILES); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 &number, &file_type)); | 92 &number, &file_type)); |
93 if (file_type == type) { | 93 if (file_type == type) { |
94 file_util::Delete(file_path, false); | 94 file_util::Delete(file_path, false); |
95 // We may have multiple files for the same type, so don't break here. | 95 // We may have multiple files for the same type, so don't break here. |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 } | 99 } |
100 | 100 |
101 } // namespace fileapi | 101 } // namespace fileapi |
OLD | NEW |