| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin2, kPersistent)); | 166 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin2, kPersistent)); |
| 167 EXPECT_FALSE(FileSystemContainsOriginAndType(kOrigin2, kTemporary)); | 167 EXPECT_FALSE(FileSystemContainsOriginAndType(kOrigin2, kTemporary)); |
| 168 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin3, kPersistent)); | 168 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin3, kPersistent)); |
| 169 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin3, kTemporary)); | 169 EXPECT_TRUE(FileSystemContainsOriginAndType(kOrigin3, kTemporary)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Uses the fileapi methods to create a filesystem of a given type for a | 172 // Uses the fileapi methods to create a filesystem of a given type for a |
| 173 // specified origin. | 173 // specified origin. |
| 174 void CreateDirectoryForOriginAndType(const GURL& origin, | 174 void CreateDirectoryForOriginAndType(const GURL& origin, |
| 175 fileapi::FileSystemType type) { | 175 fileapi::FileSystemType type) { |
| 176 base::FilePath target = sandbox_->GetFileSystemRootPathOnFileThread( | 176 base::FilePath target = sandbox_->GetBaseDirectoryForOriginAndType( |
| 177 fileapi::FileSystemURL::CreateForTest(origin, type, base::FilePath()), | 177 origin, type, true /* create */); |
| 178 true); | |
| 179 EXPECT_TRUE(file_util::DirectoryExists(target)); | 178 EXPECT_TRUE(file_util::DirectoryExists(target)); |
| 180 } | 179 } |
| 181 | 180 |
| 182 // Returns a list of the FileSystemInfo objects gathered in the most recent | 181 // Returns a list of the FileSystemInfo objects gathered in the most recent |
| 183 // call to StartFetching(). | 182 // call to StartFetching(). |
| 184 FileSystemInfoList* GetFileSystems() { | 183 FileSystemInfoList* GetFileSystems() { |
| 185 return file_system_info_list_.get(); | 184 return file_system_info_list_.get(); |
| 186 } | 185 } |
| 187 | 186 |
| 188 | 187 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // extension and devtools schemes. | 314 // extension and devtools schemes. |
| 316 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { | 315 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { |
| 317 ASSERT_TRUE(canned_helper_->empty()); | 316 ASSERT_TRUE(canned_helper_->empty()); |
| 318 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); | 317 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); |
| 319 ASSERT_TRUE(canned_helper_->empty()); | 318 ASSERT_TRUE(canned_helper_->empty()); |
| 320 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); | 319 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); |
| 321 ASSERT_TRUE(canned_helper_->empty()); | 320 ASSERT_TRUE(canned_helper_->empty()); |
| 322 } | 321 } |
| 323 | 322 |
| 324 } // namespace | 323 } // namespace |
| OLD | NEW |