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

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

Issue 23578026: Use SNAPSHOT sync mode for LocalSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding shared locking for sync+sync conflict 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 <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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 callback_count_(0), 52 callback_count_(0),
53 write_status_(base::PLATFORM_FILE_ERROR_FAILED), 53 write_status_(base::PLATFORM_FILE_ERROR_FAILED),
54 write_bytes_(0), 54 write_bytes_(0),
55 write_complete_(false), 55 write_complete_(false),
56 url_request_context_(file_system_.file_system_context()), 56 url_request_context_(file_system_.file_system_context()),
57 weak_factory_(this) {} 57 weak_factory_(this) {}
58 58
59 virtual void SetUp() OVERRIDE { 59 virtual void SetUp() OVERRIDE {
60 ASSERT_TRUE(dir_.CreateUniqueTempDir()); 60 ASSERT_TRUE(dir_.CreateUniqueTempDir());
61 file_system_.SetUp(); 61 file_system_.SetUp();
62 sync_context_ = 62 sync_context_ = new LocalFileSyncContext(
63 new LocalFileSyncContext(base::MessageLoopProxy::current().get(), 63 dir_.path(),
64 base::MessageLoopProxy::current().get()); 64 base::MessageLoopProxy::current().get(),
65 base::MessageLoopProxy::current().get());
65 ASSERT_EQ( 66 ASSERT_EQ(
66 SYNC_STATUS_OK, 67 SYNC_STATUS_OK,
67 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); 68 file_system_.MaybeInitializeFileSystemContext(sync_context_.get()));
68 69
69 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem()); 70 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem());
70 ASSERT_EQ(base::PLATFORM_FILE_OK, 71 ASSERT_EQ(base::PLATFORM_FILE_OK,
71 file_system_.CreateDirectory(URL(kParent))); 72 file_system_.CreateDirectory(URL(kParent)));
72 } 73 }
73 74
74 virtual void TearDown() OVERRIDE { 75 virtual void TearDown() OVERRIDE {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 file_system_.operation_runner()->Truncate( 388 file_system_.operation_runner()->Truncate(
388 URL(kFile), 10, 389 URL(kFile), 10,
389 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); 390 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
390 file_system_.operation_runner()->Cancel( 391 file_system_.operation_runner()->Cancel(
391 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_INVALID_OPERATION)); 392 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_INVALID_OPERATION));
392 base::MessageLoop::current()->RunUntilIdle(); 393 base::MessageLoop::current()->RunUntilIdle();
393 EXPECT_EQ(2, callback_count_); 394 EXPECT_EQ(2, callback_count_);
394 } 395 }
395 396
396 } // namespace sync_file_system 397 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698