OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "webkit/browser/fileapi/sandbox_origin_database.h" | 10 #include "webkit/browser/fileapi/sandbox_origin_database.h" |
11 #include "webkit/browser/fileapi/sandbox_prioritized_origin_database.h" | 11 #include "webkit/browser/fileapi/sandbox_prioritized_origin_database.h" |
12 | 12 |
13 namespace fileapi { | 13 using fileapi::SandboxOriginDatabase; |
| 14 using fileapi::SandboxOriginDatabaseInterface; |
| 15 using fileapi::SandboxPrioritizedOriginDatabase; |
| 16 |
| 17 namespace content { |
14 | 18 |
15 TEST(SandboxPrioritizedOriginDatabaseTest, BasicTest) { | 19 TEST(SandboxPrioritizedOriginDatabaseTest, BasicTest) { |
16 base::ScopedTempDir dir; | 20 base::ScopedTempDir dir; |
17 base::FilePath path; | 21 base::FilePath path; |
18 ASSERT_TRUE(dir.CreateUniqueTempDir()); | 22 ASSERT_TRUE(dir.CreateUniqueTempDir()); |
19 | 23 |
20 const std::string kOrigin1("origin1"); | 24 const std::string kOrigin1("origin1"); |
21 const std::string kOrigin2("origin2"); | 25 const std::string kOrigin2("origin2"); |
22 | 26 |
23 SandboxPrioritizedOriginDatabase database(dir.path(), NULL); | 27 SandboxPrioritizedOriginDatabase database(dir.path(), NULL); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 EXPECT_TRUE(base::PathExists(dir_db_path.AppendASCII("dummy"))); | 208 EXPECT_TRUE(base::PathExists(dir_db_path.AppendASCII("dummy"))); |
205 EXPECT_TRUE(base::ReadFileToString( | 209 EXPECT_TRUE(base::ReadFileToString( |
206 dir_db_path.AppendASCII("dummy"), &origin_db_data)); | 210 dir_db_path.AppendASCII("dummy"), &origin_db_data)); |
207 EXPECT_EQ(kFakeDirectoryData2, origin_db_data); | 211 EXPECT_EQ(kFakeDirectoryData2, origin_db_data); |
208 | 212 |
209 // After the migration the kOrigin1 directory database path must be gone. | 213 // After the migration the kOrigin1 directory database path must be gone. |
210 EXPECT_FALSE(base::PathExists(old_dir_db_path1)); | 214 EXPECT_FALSE(base::PathExists(old_dir_db_path1)); |
211 EXPECT_TRUE(base::PathExists(old_dir_db_path2)); | 215 EXPECT_TRUE(base::PathExists(old_dir_db_path2)); |
212 } | 216 } |
213 | 217 |
214 } // namespace fileapi | 218 } // namespace content |
OLD | NEW |