| 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 "base/stl_util.h" | 5 #include "base/stl_util.h" |
| 6 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" | 6 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" |
| 7 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" | 7 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
| 8 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 8 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
| 9 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 9 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
| 10 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 10 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class SyncableFileSystemTest : public testing::Test { | 33 class SyncableFileSystemTest : public testing::Test { |
| 34 public: | 34 public: |
| 35 SyncableFileSystemTest() | 35 SyncableFileSystemTest() |
| 36 : file_system_(GURL("http://example.com/"), | 36 : file_system_(GURL("http://example.com/"), |
| 37 base::MessageLoopProxy::current().get(), | 37 base::MessageLoopProxy::current().get(), |
| 38 base::MessageLoopProxy::current().get()), | 38 base::MessageLoopProxy::current().get()), |
| 39 weak_factory_(this) {} | 39 weak_factory_(this) {} |
| 40 | 40 |
| 41 virtual void SetUp() { | 41 virtual void SetUp() { |
| 42 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 43 |
| 42 file_system_.SetUp(); | 44 file_system_.SetUp(); |
| 43 | 45 |
| 44 sync_context_ = | 46 sync_context_ = |
| 45 new LocalFileSyncContext(base::MessageLoopProxy::current().get(), | 47 new LocalFileSyncContext(data_dir_.path(), |
| 48 base::MessageLoopProxy::current().get(), |
| 46 base::MessageLoopProxy::current().get()); | 49 base::MessageLoopProxy::current().get()); |
| 47 ASSERT_EQ( | 50 ASSERT_EQ( |
| 48 sync_file_system::SYNC_STATUS_OK, | 51 sync_file_system::SYNC_STATUS_OK, |
| 49 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 52 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); |
| 50 } | 53 } |
| 51 | 54 |
| 52 virtual void TearDown() { | 55 virtual void TearDown() { |
| 53 if (sync_context_.get()) | 56 if (sync_context_.get()) |
| 54 sync_context_->ShutdownOnUIThread(); | 57 sync_context_->ShutdownOnUIThread(); |
| 55 sync_context_ = NULL; | 58 sync_context_ = NULL; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // Now try copying the directory into the syncable file system, which should | 285 // Now try copying the directory into the syncable file system, which should |
| 283 // fail if directory operation is disabled. (http://crbug.com/161442) | 286 // fail if directory operation is disabled. (http://crbug.com/161442) |
| 284 EXPECT_NE(base::PLATFORM_FILE_OK, | 287 EXPECT_NE(base::PLATFORM_FILE_OK, |
| 285 file_system_.Copy(kSrcDir, URL("dest"))); | 288 file_system_.Copy(kSrcDir, URL("dest"))); |
| 286 | 289 |
| 287 other_file_system_.TearDown(); | 290 other_file_system_.TearDown(); |
| 288 SetEnableSyncFSDirectoryOperation(was_enabled); | 291 SetEnableSyncFSDirectoryOperation(was_enabled); |
| 289 } | 292 } |
| 290 | 293 |
| 291 } // namespace sync_file_system | 294 } // namespace sync_file_system |
| OLD | NEW |