| 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 <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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 callback_count_(0), | 53 callback_count_(0), |
| 54 write_status_(base::PLATFORM_FILE_ERROR_FAILED), | 54 write_status_(base::PLATFORM_FILE_ERROR_FAILED), |
| 55 write_bytes_(0), | 55 write_bytes_(0), |
| 56 write_complete_(false), | 56 write_complete_(false), |
| 57 url_request_context_(file_system_.file_system_context()), | 57 url_request_context_(file_system_.file_system_context()), |
| 58 weak_factory_(this) {} | 58 weak_factory_(this) {} |
| 59 | 59 |
| 60 virtual void SetUp() OVERRIDE { | 60 virtual void SetUp() OVERRIDE { |
| 61 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 61 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
| 62 file_system_.SetUp(); | 62 file_system_.SetUp(); |
| 63 sync_context_ = | 63 sync_context_ = new LocalFileSyncContext( |
| 64 new LocalFileSyncContext(base::MessageLoopProxy::current().get(), | 64 dir_.path(), |
| 65 base::MessageLoopProxy::current().get()); | 65 base::MessageLoopProxy::current().get(), |
| 66 base::MessageLoopProxy::current().get()); |
| 66 ASSERT_EQ( | 67 ASSERT_EQ( |
| 67 SYNC_STATUS_OK, | 68 SYNC_STATUS_OK, |
| 68 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 69 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); |
| 69 | 70 |
| 70 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem()); | 71 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem()); |
| 71 ASSERT_EQ(base::PLATFORM_FILE_OK, | 72 ASSERT_EQ(base::PLATFORM_FILE_OK, |
| 72 file_system_.CreateDirectory(URL(kParent))); | 73 file_system_.CreateDirectory(URL(kParent))); |
| 73 } | 74 } |
| 74 | 75 |
| 75 virtual void TearDown() OVERRIDE { | 76 virtual void TearDown() OVERRIDE { |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |