Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: content/browser/fileapi/file_system_operation_impl_unittest.cc

Issue 536453007: Add truncation to StreamCopyOrMoveImpl and test case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "webkit/browser/fileapi/file_system_operation_impl.h" 5 #include "webkit/browser/fileapi/file_system_operation_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 base::Bind(&AssertFileErrorEq, FROM_HERE, base::File::FILE_OK)); 1280 base::Bind(&AssertFileErrorEq, FROM_HERE, base::File::FILE_OK));
1281 base::RunLoop().RunUntilIdle(); 1281 base::RunLoop().RunUntilIdle();
1282 1282
1283 expected_usage += grandchild_file_size + grandchild_path_cost; 1283 expected_usage += grandchild_file_size + grandchild_path_cost;
1284 usage = GetUsage(); 1284 usage = GetUsage();
1285 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, 1285 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size,
1286 GetDataSizeOnDisk()); 1286 GetDataSizeOnDisk());
1287 EXPECT_EQ(expected_usage, usage); 1287 EXPECT_EQ(expected_usage, usage);
1288 } 1288 }
1289 1289
1290 TEST_F(FileSystemOperationImplTest,
1291 TestCopySuccessSrcFileWithDifferentFileSize) {
1292 FileSystemURL src_file(CreateFile("src"));
1293 FileSystemURL dest_file(CreateFile("dest"));
1294 operation_runner()->Truncate(dest_file, 6, RecordStatusCallback());
1295 base::RunLoop().RunUntilIdle();
1296
1297 operation_runner()->Copy(src_file,
1298 dest_file,
1299 FileSystemOperation::OPTION_NONE,
1300 FileSystemOperationRunner::CopyProgressCallback(),
1301 RecordStatusCallback());
1302 base::RunLoop().RunUntilIdle();
tzik 2014/09/03 02:07:43 This doesn't run the modified part of the code unt
iseki 2014/09/03 03:28:21 Done.
1303 EXPECT_EQ(0, GetFileSize("dest"));
1304 EXPECT_EQ(base::File::FILE_OK, status());
1305 }
1306
1290 } // namespace content 1307 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698