| 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/local_file_system_operation.h" | 5 #include "webkit/fileapi/local_file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 12 #include "base/scoped_temp_dir.h" | |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "webkit/blob/shareable_file_reference.h" | 16 #include "webkit/blob/shareable_file_reference.h" |
| 17 #include "webkit/fileapi/file_system_context.h" | 17 #include "webkit/fileapi/file_system_context.h" |
| 18 #include "webkit/fileapi/file_system_file_util.h" | 18 #include "webkit/fileapi/file_system_file_util.h" |
| 19 #include "webkit/fileapi/file_system_mount_point_provider.h" | 19 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| 20 #include "webkit/fileapi/file_system_quota_util.h" | 20 #include "webkit/fileapi/file_system_quota_util.h" |
| 21 #include "webkit/fileapi/file_system_util.h" | 21 #include "webkit/fileapi/file_system_util.h" |
| 22 #include "webkit/fileapi/file_util_helper.h" | 22 #include "webkit/fileapi/file_util_helper.h" |
| 23 #include "webkit/fileapi/local_file_system_test_helper.h" | 23 #include "webkit/fileapi/local_file_system_test_helper.h" |
| 24 #include "webkit/fileapi/mock_file_change_observer.h" | 24 #include "webkit/fileapi/mock_file_change_observer.h" |
| 25 #include "webkit/quota/mock_quota_manager.h" |
| 25 #include "webkit/quota/quota_manager.h" | 26 #include "webkit/quota/quota_manager.h" |
| 26 #include "webkit/quota/mock_quota_manager.h" | |
| 27 | 27 |
| 28 using quota::QuotaManager; | 28 using quota::QuotaManager; |
| 29 using quota::QuotaManagerProxy; | 29 using quota::QuotaManagerProxy; |
| 30 using webkit_blob::ShareableFileReference; | 30 using webkit_blob::ShareableFileReference; |
| 31 | 31 |
| 32 namespace fileapi { | 32 namespace fileapi { |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 const int kFileOperationStatusNotSet = 1; | 36 const int kFileOperationStatusNotSet = 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 64 } | 64 } |
| 65 const ShareableFileReference* shareable_file_ref() const { | 65 const ShareableFileReference* shareable_file_ref() const { |
| 66 return shareable_file_ref_; | 66 return shareable_file_ref_; |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual void SetUp() OVERRIDE; | 69 virtual void SetUp() OVERRIDE; |
| 70 virtual void TearDown() OVERRIDE; | 70 virtual void TearDown() OVERRIDE; |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 // Common temp base for nondestructive uses. | 73 // Common temp base for nondestructive uses. |
| 74 ScopedTempDir base_; | 74 base::ScopedTempDir base_; |
| 75 | 75 |
| 76 quota::MockQuotaManager* quota_manager() { | 76 quota::MockQuotaManager* quota_manager() { |
| 77 return static_cast<quota::MockQuotaManager*>(quota_manager_.get()); | 77 return static_cast<quota::MockQuotaManager*>(quota_manager_.get()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 quota::MockQuotaManagerProxy* quota_manager_proxy() { | 80 quota::MockQuotaManagerProxy* quota_manager_proxy() { |
| 81 return static_cast<quota::MockQuotaManagerProxy*>( | 81 return static_cast<quota::MockQuotaManagerProxy*>( |
| 82 quota_manager_proxy_.get()); | 82 quota_manager_proxy_.get()); |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 EXPECT_FALSE(info().is_directory); | 1200 EXPECT_FALSE(info().is_directory); |
| 1201 EXPECT_EQ(PlatformPath(file_path), path()); | 1201 EXPECT_EQ(PlatformPath(file_path), path()); |
| 1202 EXPECT_TRUE(change_observer()->HasNoChange()); | 1202 EXPECT_TRUE(change_observer()->HasNoChange()); |
| 1203 | 1203 |
| 1204 // The FileSystemOpration implementation does not create a | 1204 // The FileSystemOpration implementation does not create a |
| 1205 // shareable file reference. | 1205 // shareable file reference. |
| 1206 EXPECT_EQ(NULL, shareable_file_ref()); | 1206 EXPECT_EQ(NULL, shareable_file_ref()); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 } // namespace fileapi | 1209 } // namespace fileapi |
| OLD | NEW |