OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 SyncableFileOperationRunnerTest() | 46 SyncableFileOperationRunnerTest() |
47 : message_loop_(MessageLoop::TYPE_IO), | 47 : message_loop_(MessageLoop::TYPE_IO), |
48 file_system_(GURL("http://example.com"), kServiceName, | 48 file_system_(GURL("http://example.com"), kServiceName, |
49 base::MessageLoopProxy::current(), | 49 base::MessageLoopProxy::current(), |
50 base::MessageLoopProxy::current()), | 50 base::MessageLoopProxy::current()), |
51 callback_count_(0), | 51 callback_count_(0), |
52 write_status_(base::PLATFORM_FILE_ERROR_FAILED), | 52 write_status_(base::PLATFORM_FILE_ERROR_FAILED), |
53 write_bytes_(0), | 53 write_bytes_(0), |
54 write_complete_(false), | 54 write_complete_(false), |
55 url_request_context_(file_system_.file_system_context()), | 55 url_request_context_(file_system_.file_system_context()), |
56 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} | 56 weak_factory_(this) {} |
57 | 57 |
58 virtual void SetUp() OVERRIDE { | 58 virtual void SetUp() OVERRIDE { |
59 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 59 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
60 file_system_.SetUp(); | 60 file_system_.SetUp(); |
61 sync_context_ = new LocalFileSyncContext(base::MessageLoopProxy::current(), | 61 sync_context_ = new LocalFileSyncContext(base::MessageLoopProxy::current(), |
62 base::MessageLoopProxy::current()); | 62 base::MessageLoopProxy::current()); |
63 ASSERT_EQ(SYNC_STATUS_OK, | 63 ASSERT_EQ(SYNC_STATUS_OK, |
64 file_system_.MaybeInitializeFileSystemContext(sync_context_)); | 64 file_system_.MaybeInitializeFileSystemContext(sync_context_)); |
65 | 65 |
66 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem()); | 66 ASSERT_EQ(base::PLATFORM_FILE_OK, file_system_.OpenFileSystem()); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // Now the file must have been created and have the same content as temp_path. | 362 // Now the file must have been created and have the same content as temp_path. |
363 ResetCallbackStatus(); | 363 ResetCallbackStatus(); |
364 file_system_.DoVerifyFile( | 364 file_system_.DoVerifyFile( |
365 URL(kFile), kTestData, | 365 URL(kFile), kTestData, |
366 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); | 366 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); |
367 MessageLoop::current()->RunUntilIdle(); | 367 MessageLoop::current()->RunUntilIdle(); |
368 EXPECT_EQ(1, callback_count_); | 368 EXPECT_EQ(1, callback_count_); |
369 } | 369 } |
370 | 370 |
371 } // namespace sync_file_system | 371 } // namespace sync_file_system |
OLD | NEW |