| 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_directory_database.h" | 5 #include "webkit/browser/fileapi/sandbox_directory_database.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 17 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 18 #include "webkit/browser/fileapi/sandbox_database_test_helper.h" | 18 #include "webkit/browser/fileapi/sandbox_database_test_helper.h" |
| 19 #include "webkit/common/fileapi/file_system_util.h" | 19 #include "webkit/common/fileapi/file_system_util.h" |
| 20 | 20 |
| 21 #define FPL(x) FILE_PATH_LITERAL(x) | 21 #define FPL(x) FILE_PATH_LITERAL(x) |
| 22 | 22 |
| 23 namespace fileapi { | 23 using fileapi::CorruptDatabase; |
| 24 using fileapi::DeleteDatabaseFile; |
| 25 using fileapi::FilePathToString; |
| 26 using fileapi::SandboxDirectoryDatabase; |
| 27 |
| 28 namespace content { |
| 24 | 29 |
| 25 namespace { | 30 namespace { |
| 26 const base::FilePath::CharType kDirectoryDatabaseName[] = FPL("Paths"); | 31 const base::FilePath::CharType kDirectoryDatabaseName[] = FPL("Paths"); |
| 27 } | 32 } |
| 28 | 33 |
| 29 class SandboxDirectoryDatabaseTest : public testing::Test { | 34 class SandboxDirectoryDatabaseTest : public testing::Test { |
| 30 public: | 35 public: |
| 31 typedef SandboxDirectoryDatabase::FileId FileId; | 36 typedef SandboxDirectoryDatabase::FileId FileId; |
| 32 typedef SandboxDirectoryDatabase::FileInfo FileInfo; | 37 typedef SandboxDirectoryDatabase::FileInfo FileInfo; |
| 33 | 38 |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 InitDatabase(); | 667 InitDatabase(); |
| 663 EXPECT_FALSE(db()->IsFileSystemConsistent()); | 668 EXPECT_FALSE(db()->IsFileSystemConsistent()); |
| 664 | 669 |
| 665 FileId file_id; | 670 FileId file_id; |
| 666 EXPECT_TRUE(db()->GetChildWithName(0, kFileName, &file_id)); | 671 EXPECT_TRUE(db()->GetChildWithName(0, kFileName, &file_id)); |
| 667 EXPECT_EQ(file_id_prev, file_id); | 672 EXPECT_EQ(file_id_prev, file_id); |
| 668 | 673 |
| 669 EXPECT_TRUE(db()->IsFileSystemConsistent()); | 674 EXPECT_TRUE(db()->IsFileSystemConsistent()); |
| 670 } | 675 } |
| 671 | 676 |
| 672 } // namespace fileapi | 677 } // namespace content |
| OLD | NEW |