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

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

Issue 23578026: Use SNAPSHOT sync mode for LocalSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 3 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 "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 20 matching lines...) Expand all
31 31
32 class SyncableFileSystemTest : public testing::Test { 32 class SyncableFileSystemTest : public testing::Test {
33 public: 33 public:
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 ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
42
41 file_system_.SetUp(); 43 file_system_.SetUp();
42 44
43 sync_context_ = 45 sync_context_ =
44 new LocalFileSyncContext(base::MessageLoopProxy::current().get(), 46 new LocalFileSyncContext(data_dir_.path(),
47 base::MessageLoopProxy::current().get(),
45 base::MessageLoopProxy::current().get()); 48 base::MessageLoopProxy::current().get());
46 ASSERT_EQ( 49 ASSERT_EQ(
47 sync_file_system::SYNC_STATUS_OK, 50 sync_file_system::SYNC_STATUS_OK,
48 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); 51 file_system_.MaybeInitializeFileSystemContext(sync_context_.get()));
49 } 52 }
50 53
51 virtual void TearDown() { 54 virtual void TearDown() {
52 if (sync_context_.get()) 55 if (sync_context_.get())
53 sync_context_->ShutdownOnUIThread(); 56 sync_context_->ShutdownOnUIThread();
54 sync_context_ = NULL; 57 sync_context_ = NULL;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // Now try copying the directory into the syncable file system, which should 284 // Now try copying the directory into the syncable file system, which should
282 // fail if directory operation is disabled. (http://crbug.com/161442) 285 // fail if directory operation is disabled. (http://crbug.com/161442)
283 EXPECT_NE(base::PLATFORM_FILE_OK, 286 EXPECT_NE(base::PLATFORM_FILE_OK,
284 file_system_.Copy(kSrcDir, URL("dest"))); 287 file_system_.Copy(kSrcDir, URL("dest")));
285 288
286 other_file_system_.TearDown(); 289 other_file_system_.TearDown();
287 SetEnableSyncFSDirectoryOperation(was_enabled); 290 SetEnableSyncFSDirectoryOperation(was_enabled);
288 } 291 }
289 292
290 } // namespace sync_file_system 293 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698