| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 const OriginEnumerationTestRecord kOriginEnumerationTestRecords[] = { | 84 const OriginEnumerationTestRecord kOriginEnumerationTestRecords[] = { |
| 85 {"http://example.com", false, true}, | 85 {"http://example.com", false, true}, |
| 86 {"http://example1.com", true, false}, | 86 {"http://example1.com", true, false}, |
| 87 {"https://example1.com", true, true}, | 87 {"https://example1.com", true, true}, |
| 88 {"file://", false, true}, | 88 {"file://", false, true}, |
| 89 {"http://example.com:8000", false, true}, | 89 {"http://example.com:8000", false, true}, |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 FileSystemURL FileSystemURLAppend( | 92 FileSystemURL FileSystemURLAppend( |
| 93 const FileSystemURL& url, const FilePath::StringType& child) { | 93 const FileSystemURL& url, const base::FilePath::StringType& child) { |
| 94 return FileSystemURL::CreateForTest( | 94 return FileSystemURL::CreateForTest( |
| 95 url.origin(), url.mount_type(), url.virtual_path().Append(child)); | 95 url.origin(), url.mount_type(), url.virtual_path().Append(child)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 FileSystemURL FileSystemURLAppendUTF8( | 98 FileSystemURL FileSystemURLAppendUTF8( |
| 99 const FileSystemURL& url, const std::string& child) { | 99 const FileSystemURL& url, const std::string& child) { |
| 100 return FileSystemURL::CreateForTest( | 100 return FileSystemURL::CreateForTest( |
| 101 url.origin(), | 101 url.origin(), |
| 102 url.mount_type(), | 102 url.mount_type(), |
| 103 url.virtual_path().Append(FilePath::FromUTF8Unsafe(child))); | 103 url.virtual_path().Append(base::FilePath::FromUTF8Unsafe(child))); |
| 104 } | 104 } |
| 105 | 105 |
| 106 FileSystemURL FileSystemURLDirName(const FileSystemURL& url) { | 106 FileSystemURL FileSystemURLDirName(const FileSystemURL& url) { |
| 107 return FileSystemURL::CreateForTest( | 107 return FileSystemURL::CreateForTest( |
| 108 url.origin(), url.mount_type(), url.virtual_path().DirName()); | 108 url.origin(), url.mount_type(), url.virtual_path().DirName()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace (anonymous) | 111 } // namespace (anonymous) |
| 112 | 112 |
| 113 // TODO(ericu): The vast majority of this and the other FSFU subclass tests | 113 // TODO(ericu): The vast majority of this and the other FSFU subclass tests |
| (...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 ASSERT_EQ(base::PLATFORM_FILE_OK, | 2241 ASSERT_EQ(base::PLATFORM_FILE_OK, |
| 2242 ofu()->CreateOrOpen( | 2242 ofu()->CreateOrOpen( |
| 2243 AllowUsageIncrease(-length)->context(), file, | 2243 AllowUsageIncrease(-length)->context(), file, |
| 2244 base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_WRITE, | 2244 base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_WRITE, |
| 2245 &file_handle, &created)); | 2245 &file_handle, &created)); |
| 2246 ASSERT_EQ(0, ComputeTotalFileSize()); | 2246 ASSERT_EQ(0, ComputeTotalFileSize()); |
| 2247 EXPECT_TRUE(base::ClosePlatformFile(file_handle)); | 2247 EXPECT_TRUE(base::ClosePlatformFile(file_handle)); |
| 2248 } | 2248 } |
| 2249 | 2249 |
| 2250 } // namespace fileapi | 2250 } // namespace fileapi |
| OLD | NEW |