 Chromium Code Reviews
 Chromium Code Reviews Issue 23578026:
  Use SNAPSHOT sync mode for LocalSync  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 23578026:
  Use SNAPSHOT sync mode for LocalSync  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 23 matching lines...) Expand all Loading... | |
| 34 SyncableFileSystemTest() | 34 SyncableFileSystemTest() | 
| 35 : file_system_(GURL("http://example.com/"), | 35 : file_system_(GURL("http://example.com/"), | 
| 36 base::MessageLoopProxy::current().get(), | 36 base::MessageLoopProxy::current().get(), | 
| 37 base::MessageLoopProxy::current().get()), | 37 base::MessageLoopProxy::current().get()), | 
| 38 weak_factory_(this) {} | 38 weak_factory_(this) {} | 
| 39 | 39 | 
| 40 virtual void SetUp() { | 40 virtual void SetUp() { | 
| 41 file_system_.SetUp(); | 41 file_system_.SetUp(); | 
| 42 | 42 | 
| 43 sync_context_ = | 43 sync_context_ = | 
| 44 new LocalFileSyncContext(base::MessageLoopProxy::current().get(), | 44 new LocalFileSyncContext(base::FilePath(), | 
| 
tzik
2013/09/17 07:48:41
maybe, this needs another ScopedTempDir.
 
kinuko
2013/09/17 11:04:43
Done.
 | |
| 45 base::MessageLoopProxy::current().get(), | |
| 45 base::MessageLoopProxy::current().get()); | 46 base::MessageLoopProxy::current().get()); | 
| 46 ASSERT_EQ( | 47 ASSERT_EQ( | 
| 47 sync_file_system::SYNC_STATUS_OK, | 48 sync_file_system::SYNC_STATUS_OK, | 
| 48 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 49 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 
| 49 } | 50 } | 
| 50 | 51 | 
| 51 virtual void TearDown() { | 52 virtual void TearDown() { | 
| 52 if (sync_context_.get()) | 53 if (sync_context_.get()) | 
| 53 sync_context_->ShutdownOnUIThread(); | 54 sync_context_->ShutdownOnUIThread(); | 
| 54 sync_context_ = NULL; | 55 sync_context_ = NULL; | 
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 // Now try copying the directory into the syncable file system, which should | 282 // Now try copying the directory into the syncable file system, which should | 
| 282 // fail if directory operation is disabled. (http://crbug.com/161442) | 283 // fail if directory operation is disabled. (http://crbug.com/161442) | 
| 283 EXPECT_NE(base::PLATFORM_FILE_OK, | 284 EXPECT_NE(base::PLATFORM_FILE_OK, | 
| 284 file_system_.Copy(kSrcDir, URL("dest"))); | 285 file_system_.Copy(kSrcDir, URL("dest"))); | 
| 285 | 286 | 
| 286 other_file_system_.TearDown(); | 287 other_file_system_.TearDown(); | 
| 287 SetEnableSyncFSDirectoryOperation(was_enabled); | 288 SetEnableSyncFSDirectoryOperation(was_enabled); | 
| 288 } | 289 } | 
| 289 | 290 | 
| 290 } // namespace sync_file_system | 291 } // namespace sync_file_system | 
| OLD | NEW |