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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
5 #include <string> | 8 #include <string> |
6 | 9 |
7 #include "base/basictypes.h" | |
8 #include "base/files/file.h" | 10 #include "base/files/file.h" |
9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
10 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
13 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
14 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
15 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" | 18 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" |
16 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" | 19 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
17 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 20 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
18 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" | 21 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" |
19 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 22 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
20 #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
" | 23 #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 weak_factory_.GetWeakPtr(), location, expect); | 115 weak_factory_.GetWeakPtr(), location, expect); |
113 } | 116 } |
114 | 117 |
115 FileSystemOperation::WriteCallback GetWriteCallback( | 118 FileSystemOperation::WriteCallback GetWriteCallback( |
116 const tracked_objects::Location& location) { | 119 const tracked_objects::Location& location) { |
117 return base::Bind(&SyncableFileOperationRunnerTest::DidWrite, | 120 return base::Bind(&SyncableFileOperationRunnerTest::DidWrite, |
118 weak_factory_.GetWeakPtr(), location); | 121 weak_factory_.GetWeakPtr(), location); |
119 } | 122 } |
120 | 123 |
121 void DidWrite(const tracked_objects::Location& location, | 124 void DidWrite(const tracked_objects::Location& location, |
122 File::Error status, int64 bytes, bool complete) { | 125 File::Error status, |
| 126 int64_t bytes, |
| 127 bool complete) { |
123 SCOPED_TRACE(testing::Message() << location.ToString()); | 128 SCOPED_TRACE(testing::Message() << location.ToString()); |
124 write_status_ = status; | 129 write_status_ = status; |
125 write_bytes_ += bytes; | 130 write_bytes_ += bytes; |
126 write_complete_ = complete; | 131 write_complete_ = complete; |
127 ++callback_count_; | 132 ++callback_count_; |
128 } | 133 } |
129 | 134 |
130 void DidFinish(const tracked_objects::Location& location, | 135 void DidFinish(const tracked_objects::Location& location, |
131 File::Error expect, File::Error status) { | 136 File::Error expect, File::Error status) { |
132 SCOPED_TRACE(testing::Message() << location.ToString()); | 137 SCOPED_TRACE(testing::Message() << location.ToString()); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 storage::FileSystemOperationRunner::OperationID id = | 407 storage::FileSystemOperationRunner::OperationID id = |
403 file_system_.operation_runner()->Truncate( | 408 file_system_.operation_runner()->Truncate( |
404 URL(kFile), 10, ExpectStatus(FROM_HERE, File::FILE_OK)); | 409 URL(kFile), 10, ExpectStatus(FROM_HERE, File::FILE_OK)); |
405 file_system_.operation_runner()->Cancel( | 410 file_system_.operation_runner()->Cancel( |
406 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); | 411 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); |
407 base::RunLoop().Run(); | 412 base::RunLoop().Run(); |
408 EXPECT_EQ(2, callback_count_); | 413 EXPECT_EQ(2, callback_count_); |
409 } | 414 } |
410 | 415 |
411 } // namespace sync_file_system | 416 } // namespace sync_file_system |
OLD | NEW |