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/sandbox_mount_point_provider.h" | 5 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 protected: | 46 protected: |
47 void CreateOriginTypeDirectory(const GURL& origin, | 47 void CreateOriginTypeDirectory(const GURL& origin, |
48 fileapi::FileSystemType type) { | 48 fileapi::FileSystemType type) { |
49 FilePath target = sandbox_provider_-> | 49 FilePath target = sandbox_provider_-> |
50 GetBaseDirectoryForOriginAndType(origin, type, true); | 50 GetBaseDirectoryForOriginAndType(origin, type, true); |
51 ASSERT_TRUE(!target.empty()); | 51 ASSERT_TRUE(!target.empty()); |
52 ASSERT_TRUE(file_util::DirectoryExists(target)); | 52 ASSERT_TRUE(file_util::DirectoryExists(target)); |
53 } | 53 } |
54 | 54 |
55 ScopedTempDir data_dir_; | 55 ScopedTempDir data_dir_; |
| 56 MessageLoop message_loop_; |
56 scoped_ptr<SandboxMountPointProvider> sandbox_provider_; | 57 scoped_ptr<SandboxMountPointProvider> sandbox_provider_; |
57 }; | 58 }; |
58 | 59 |
59 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, Empty) { | 60 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, Empty) { |
60 scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator( | 61 scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator( |
61 CreateEnumerator()); | 62 CreateEnumerator()); |
62 ASSERT_TRUE(enumerator->Next().is_empty()); | 63 ASSERT_TRUE(enumerator->Next().is_empty()); |
63 } | 64 } |
64 | 65 |
65 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, EnumerateOrigins) { | 66 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, EnumerateOrigins) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ASSERT_TRUE(test_case.has_temporary || test_case.has_persistent); | 338 ASSERT_TRUE(test_case.has_temporary || test_case.has_persistent); |
338 if (test_case.has_temporary) | 339 if (test_case.has_temporary) |
339 ValidateDataInNewFileSystem(origin_url, kFileSystemTypeTemporary); | 340 ValidateDataInNewFileSystem(origin_url, kFileSystemTypeTemporary); |
340 if (test_case.has_persistent) | 341 if (test_case.has_persistent) |
341 ValidateDataInNewFileSystem(origin_url, kFileSystemTypePersistent); | 342 ValidateDataInNewFileSystem(origin_url, kFileSystemTypePersistent); |
342 } | 343 } |
343 } | 344 } |
344 | 345 |
345 protected: | 346 protected: |
346 ScopedTempDir data_dir_; | 347 ScopedTempDir data_dir_; |
| 348 MessageLoop message_loop_; |
347 scoped_refptr<FileSystemContext> file_system_context_; | 349 scoped_refptr<FileSystemContext> file_system_context_; |
348 base::WeakPtrFactory<SandboxMountPointProviderMigrationTest> weak_factory_; | 350 base::WeakPtrFactory<SandboxMountPointProviderMigrationTest> weak_factory_; |
349 }; | 351 }; |
350 | 352 |
351 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod0) { | 353 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod0) { |
352 RunMigrationTest(0); | 354 RunMigrationTest(0); |
353 } | 355 } |
354 | 356 |
355 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod1) { | 357 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod1) { |
356 RunMigrationTest(1); | 358 RunMigrationTest(1); |
(...skipping 25 matching lines...) Expand all Loading... |
382 | 384 |
383 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod8) { | 385 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod8) { |
384 RunMigrationTest(8); | 386 RunMigrationTest(8); |
385 } | 387 } |
386 | 388 |
387 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod9) { | 389 TEST_F(SandboxMountPointProviderMigrationTest, TestMigrateViaMethod9) { |
388 RunMigrationTest(9); | 390 RunMigrationTest(9); |
389 } | 391 } |
390 | 392 |
391 } // namespace fileapi | 393 } // namespace fileapi |
OLD | NEW |