| 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 <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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 ResetCallbackStatus(); | 326 ResetCallbackStatus(); |
| 327 | 327 |
| 328 // This shouldn't crash nor leak memory. | 328 // This shouldn't crash nor leak memory. |
| 329 sync_context_->ShutdownOnUIThread(); | 329 sync_context_->ShutdownOnUIThread(); |
| 330 sync_context_ = NULL; | 330 sync_context_ = NULL; |
| 331 base::MessageLoop::current()->RunUntilIdle(); | 331 base::MessageLoop::current()->RunUntilIdle(); |
| 332 EXPECT_EQ(2, callback_count_); | 332 EXPECT_EQ(2, callback_count_); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // Test if CopyInForeignFile runs cooperatively with other Sync operations | 335 // Test if CopyInForeignFile runs cooperatively with other Sync operations |
| 336 // when it is called directly via AsLocalFileSystemOperation. | 336 // when it is called directly via AsFileSystemOperationImpl. |
| 337 TEST_F(SyncableFileOperationRunnerTest, CopyInForeignFile) { | 337 TEST_F(SyncableFileOperationRunnerTest, CopyInForeignFile) { |
| 338 const std::string kTestData("test data"); | 338 const std::string kTestData("test data"); |
| 339 | 339 |
| 340 base::FilePath temp_path; | 340 base::FilePath temp_path; |
| 341 ASSERT_TRUE(CreateTempFile(&temp_path)); | 341 ASSERT_TRUE(CreateTempFile(&temp_path)); |
| 342 ASSERT_EQ(static_cast<int>(kTestData.size()), | 342 ASSERT_EQ(static_cast<int>(kTestData.size()), |
| 343 file_util::WriteFile( | 343 file_util::WriteFile( |
| 344 temp_path, kTestData.data(), kTestData.size())); | 344 temp_path, kTestData.data(), kTestData.size())); |
| 345 | 345 |
| 346 sync_status()->StartSyncing(URL(kFile)); | 346 sync_status()->StartSyncing(URL(kFile)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 file_system_.operation_runner()->Truncate( | 385 file_system_.operation_runner()->Truncate( |
| 386 URL(kFile), 10, | 386 URL(kFile), 10, |
| 387 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT)); | 387 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT)); |
| 388 file_system_.operation_runner()->Cancel( | 388 file_system_.operation_runner()->Cancel( |
| 389 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); | 389 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); |
| 390 base::MessageLoop::current()->RunUntilIdle(); | 390 base::MessageLoop::current()->RunUntilIdle(); |
| 391 EXPECT_EQ(2, callback_count_); | 391 EXPECT_EQ(2, callback_count_); |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace sync_file_system | 394 } // namespace sync_file_system |
| OLD | NEW |