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/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 FilePath target = sandbox_->GetFileSystemRootPathOnFileThread( | 176 FilePath target = sandbox_->GetFileSystemRootPathOnFileThread( |
177 fileapi::FileSystemURL(origin, type, FilePath()), true); | 177 fileapi::FileSystemURL::CreateForTest(origin, type, FilePath()), true); |
178 EXPECT_TRUE(file_util::DirectoryExists(target)); | 178 EXPECT_TRUE(file_util::DirectoryExists(target)); |
179 } | 179 } |
180 | 180 |
181 // 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 |
182 // call to StartFetching(). | 182 // call to StartFetching(). |
183 FileSystemInfoList* GetFileSystems() { | 183 FileSystemInfoList* GetFileSystems() { |
184 return file_system_info_list_.get(); | 184 return file_system_info_list_.get(); |
185 } | 185 } |
186 | 186 |
187 | 187 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // extension and devtools schemes. | 314 // extension and devtools schemes. |
315 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { | 315 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { |
316 ASSERT_TRUE(canned_helper_->empty()); | 316 ASSERT_TRUE(canned_helper_->empty()); |
317 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); | 317 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); |
318 ASSERT_TRUE(canned_helper_->empty()); | 318 ASSERT_TRUE(canned_helper_->empty()); |
319 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); | 319 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); |
320 ASSERT_TRUE(canned_helper_->empty()); | 320 ASSERT_TRUE(canned_helper_->empty()); |
321 } | 321 } |
322 | 322 |
323 } // namespace | 323 } // namespace |
OLD | NEW |