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

Side by Side Diff: chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 EXPECT_EQ(2, callback_count_); 348 EXPECT_EQ(2, callback_count_);
349 } 349 }
350 350
351 // Test if CopyInForeignFile runs cooperatively with other Sync operations. 351 // Test if CopyInForeignFile runs cooperatively with other Sync operations.
352 TEST_F(SyncableFileOperationRunnerTest, CopyInForeignFile) { 352 TEST_F(SyncableFileOperationRunnerTest, CopyInForeignFile) {
353 const std::string kTestData("test data"); 353 const std::string kTestData("test data");
354 354
355 base::FilePath temp_path; 355 base::FilePath temp_path;
356 ASSERT_TRUE(CreateTempFile(&temp_path)); 356 ASSERT_TRUE(CreateTempFile(&temp_path));
357 ASSERT_EQ(static_cast<int>(kTestData.size()), 357 ASSERT_EQ(static_cast<int>(kTestData.size()),
358 file_util::WriteFile( 358 base::WriteFile(
359 temp_path, kTestData.data(), kTestData.size())); 359 temp_path, kTestData.data(), kTestData.size()));
360 360
361 sync_status()->StartSyncing(URL(kFile)); 361 sync_status()->StartSyncing(URL(kFile));
362 ASSERT_FALSE(sync_status()->IsWritable(URL(kFile))); 362 ASSERT_FALSE(sync_status()->IsWritable(URL(kFile)));
363 363
364 // The URL is in syncing so CopyIn (which is a write operation) won't run. 364 // The URL is in syncing so CopyIn (which is a write operation) won't run.
365 ResetCallbackStatus(); 365 ResetCallbackStatus();
366 file_system_.operation_runner()->CopyInForeignFile( 366 file_system_.operation_runner()->CopyInForeignFile(
367 temp_path, URL(kFile), 367 temp_path, URL(kFile),
368 ExpectStatus(FROM_HERE, File::FILE_OK)); 368 ExpectStatus(FROM_HERE, File::FILE_OK));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 file_system_.operation_runner()->Truncate( 400 file_system_.operation_runner()->Truncate(
401 URL(kFile), 10, 401 URL(kFile), 10,
402 ExpectStatus(FROM_HERE, File::FILE_OK)); 402 ExpectStatus(FROM_HERE, File::FILE_OK));
403 file_system_.operation_runner()->Cancel( 403 file_system_.operation_runner()->Cancel(
404 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); 404 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION));
405 base::MessageLoop::current()->RunUntilIdle(); 405 base::MessageLoop::current()->RunUntilIdle();
406 EXPECT_EQ(2, callback_count_); 406 EXPECT_EQ(2, callback_count_);
407 } 407 }
408 408
409 } // namespace sync_file_system 409 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698