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/fileapi/file_system_directory_database.h" | 5 #include "webkit/fileapi/file_system_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" |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 &created, &error); | 562 &created, &error); |
563 ASSERT_EQ(base::PLATFORM_FILE_OK, error); | 563 ASSERT_EQ(base::PLATFORM_FILE_OK, error); |
564 ASSERT_TRUE(created); | 564 ASSERT_TRUE(created); |
565 ASSERT_TRUE(base::ClosePlatformFile(file)); | 565 ASSERT_TRUE(base::ClosePlatformFile(file)); |
566 | 566 |
567 EXPECT_TRUE(db()->IsFileSystemConsistent()); | 567 EXPECT_TRUE(db()->IsFileSystemConsistent()); |
568 } | 568 } |
569 | 569 |
570 TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_RootLoop) { | 570 TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_RootLoop) { |
571 EXPECT_TRUE(db()->IsFileSystemConsistent()); | 571 EXPECT_TRUE(db()->IsFileSystemConsistent()); |
572 MakeHierarchyLink(0, 0, FPL("")); | 572 MakeHierarchyLink(0, 0, base::FilePath::StringType()); |
573 EXPECT_FALSE(db()->IsFileSystemConsistent()); | 573 EXPECT_FALSE(db()->IsFileSystemConsistent()); |
574 } | 574 } |
575 | 575 |
576 TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_DirectoryLoop) { | 576 TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_DirectoryLoop) { |
577 FileId dir1_id; | 577 FileId dir1_id; |
578 FileId dir2_id; | 578 FileId dir2_id; |
579 base::FilePath::StringType dir1_name = FPL("foo"); | 579 base::FilePath::StringType dir1_name = FPL("foo"); |
580 CreateDirectory(0, dir1_name, &dir1_id); | 580 CreateDirectory(0, dir1_name, &dir1_id); |
581 CreateDirectory(dir1_id, FPL("bar"), &dir2_id); | 581 CreateDirectory(dir1_id, FPL("bar"), &dir2_id); |
582 | 582 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 -1, 1); | 644 -1, 1); |
645 InitDatabase(); | 645 InitDatabase(); |
646 EXPECT_FALSE(db()->IsFileSystemConsistent()); | 646 EXPECT_FALSE(db()->IsFileSystemConsistent()); |
647 | 647 |
648 FileId file_id; | 648 FileId file_id; |
649 EXPECT_FALSE(db()->GetChildWithName(0, kFileName, &file_id)); | 649 EXPECT_FALSE(db()->GetChildWithName(0, kFileName, &file_id)); |
650 EXPECT_TRUE(db()->IsFileSystemConsistent()); | 650 EXPECT_TRUE(db()->IsFileSystemConsistent()); |
651 } | 651 } |
652 | 652 |
653 } // namespace fileapi | 653 } // namespace fileapi |
OLD | NEW |