| 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 "webkit/fileapi/syncable/local_file_sync_context.h" | 5 #include "webkit/fileapi/syncable/local_file_sync_context.h" |
| 6 | 6 |
| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 EXPECT_EQ(quota::kQuotaStatusOk, | 460 EXPECT_EQ(quota::kQuotaStatusOk, |
| 461 file_system.GetUsageAndQuota(&new_usage, "a)); | 461 file_system.GetUsageAndQuota(&new_usage, "a)); |
| 462 EXPECT_EQ(new_usage, initial_usage); | 462 EXPECT_EQ(new_usage, initial_usage); |
| 463 | 463 |
| 464 sync_context_->ShutdownOnUIThread(); | 464 sync_context_->ShutdownOnUIThread(); |
| 465 sync_context_ = NULL; | 465 sync_context_ = NULL; |
| 466 file_system.TearDown(); | 466 file_system.TearDown(); |
| 467 } | 467 } |
| 468 | 468 |
| 469 TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { | 469 TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { |
| 470 ScopedTempDir temp_dir; | 470 base::ScopedTempDir temp_dir; |
| 471 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 471 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 472 | 472 |
| 473 CannedSyncableFileSystem file_system(GURL(kOrigin1), kServiceName, | 473 CannedSyncableFileSystem file_system(GURL(kOrigin1), kServiceName, |
| 474 io_task_runner_, file_task_runner_); | 474 io_task_runner_, file_task_runner_); |
| 475 file_system.SetUp(); | 475 file_system.SetUp(); |
| 476 | 476 |
| 477 sync_context_ = new LocalFileSyncContext(ui_task_runner_, io_task_runner_); | 477 sync_context_ = new LocalFileSyncContext(ui_task_runner_, io_task_runner_); |
| 478 ASSERT_EQ(SYNC_STATUS_OK, | 478 ASSERT_EQ(SYNC_STATUS_OK, |
| 479 file_system.MaybeInitializeFileSystemContext(sync_context_)); | 479 file_system.MaybeInitializeFileSystemContext(sync_context_)); |
| 480 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system.OpenFileSystem()); | 480 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system.OpenFileSystem()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // Make sure all three files/directory exist. | 594 // Make sure all three files/directory exist. |
| 595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1)); | 595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1)); |
| 596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2)); | 596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2)); |
| 597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir)); | 597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir)); |
| 598 | 598 |
| 599 sync_context_->ShutdownOnUIThread(); | 599 sync_context_->ShutdownOnUIThread(); |
| 600 file_system.TearDown(); | 600 file_system.TearDown(); |
| 601 } | 601 } |
| 602 | 602 |
| 603 } // namespace fileapi | 603 } // namespace fileapi |
| OLD | NEW |