OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); | 2180 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); |
2181 | 2181 |
2182 int64 from_file_size = 1020; | 2182 int64 from_file_size = 1020; |
2183 expected_total_file_size += from_file_size; | 2183 expected_total_file_size += from_file_size; |
2184 ASSERT_EQ(base::File::FILE_OK, | 2184 ASSERT_EQ(base::File::FILE_OK, |
2185 ofu()->Truncate( | 2185 ofu()->Truncate( |
2186 AllowUsageIncrease(from_file_size)->context(), | 2186 AllowUsageIncrease(from_file_size)->context(), |
2187 from_file, from_file_size)); | 2187 from_file, from_file_size)); |
2188 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); | 2188 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); |
2189 | 2189 |
2190 int64 to_file_size ALLOW_UNUSED = from_file_size; | |
2191 from_file_size = 0; | 2190 from_file_size = 0; |
2192 ASSERT_EQ(base::File::FILE_OK, | 2191 ASSERT_EQ(base::File::FILE_OK, |
2193 ofu()->CopyOrMoveFile( | 2192 ofu()->CopyOrMoveFile( |
2194 AllowUsageIncrease(-PathCost(from_file) + | 2193 AllowUsageIncrease(-PathCost(from_file) + |
2195 PathCost(to_file))->context(), | 2194 PathCost(to_file))->context(), |
2196 from_file, to_file, | 2195 from_file, to_file, |
2197 FileSystemOperation::OPTION_NONE, | 2196 FileSystemOperation::OPTION_NONE, |
2198 false /* move */)); | 2197 false /* move */)); |
2199 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); | 2198 ASSERT_EQ(expected_total_file_size, ComputeTotalFileSize()); |
2200 | 2199 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2444 false /* exclusive */, | 2443 false /* exclusive */, |
2445 true /* recursive */)); | 2444 true /* recursive */)); |
2446 ASSERT_EQ(base::File::FILE_ERROR_NOT_A_DIRECTORY, | 2445 ASSERT_EQ(base::File::FILE_ERROR_NOT_A_DIRECTORY, |
2447 ofu()->CreateDirectory(UnlimitedContext().get(), | 2446 ofu()->CreateDirectory(UnlimitedContext().get(), |
2448 path_in_file_in_file, | 2447 path_in_file_in_file, |
2449 false /* exclusive */, | 2448 false /* exclusive */, |
2450 true /* recursive */)); | 2449 true /* recursive */)); |
2451 } | 2450 } |
2452 | 2451 |
2453 } // namespace content | 2452 } // namespace content |
OLD | NEW |