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" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "webkit/browser/blob/mock_blob_url_request_context.h" | 13 #include "webkit/browser/blob/mock_blob_url_request_context.h" |
14 #include "webkit/browser/fileapi/file_system_context.h" | 14 #include "webkit/browser/fileapi/file_system_context.h" |
15 #include "webkit/browser/fileapi/file_system_operation_runner.h" | 15 #include "webkit/browser/fileapi/file_system_operation_runner.h" |
16 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" | 16 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" |
17 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" | 17 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" |
18 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" | 18 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" |
19 #include "webkit/browser/fileapi/syncable/local_file_sync_status.h" | 19 #include "webkit/browser/fileapi/syncable/local_file_sync_status.h" |
| 20 #include "webkit/browser/fileapi/syncable/sync_file_system_backend.h" |
20 #include "webkit/browser/fileapi/syncable/syncable_file_operation_runner.h" | 21 #include "webkit/browser/fileapi/syncable/syncable_file_operation_runner.h" |
21 #include "webkit/browser/fileapi/syncable/syncable_file_system_operation.h" | 22 #include "webkit/browser/fileapi/syncable/syncable_file_system_operation.h" |
22 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" | 23 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" |
23 | 24 |
24 using fileapi::FileSystemOperation; | 25 using fileapi::FileSystemOperation; |
25 using fileapi::FileSystemURL; | 26 using fileapi::FileSystemURL; |
26 using webkit_blob::MockBlobURLRequestContext; | 27 using webkit_blob::MockBlobURLRequestContext; |
27 using webkit_blob::ScopedTextBlob; | 28 using webkit_blob::ScopedTextBlob; |
28 using base::PlatformFileError; | 29 using base::PlatformFileError; |
29 | 30 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 file_system_.TearDown(); | 79 file_system_.TearDown(); |
79 message_loop_.RunUntilIdle(); | 80 message_loop_.RunUntilIdle(); |
80 RevokeSyncableFileSystem(); | 81 RevokeSyncableFileSystem(); |
81 } | 82 } |
82 | 83 |
83 FileSystemURL URL(const std::string& path) { | 84 FileSystemURL URL(const std::string& path) { |
84 return file_system_.URL(path); | 85 return file_system_.URL(path); |
85 } | 86 } |
86 | 87 |
87 LocalFileSyncStatus* sync_status() { | 88 LocalFileSyncStatus* sync_status() { |
88 return file_system_.file_system_context()->sync_context()->sync_status(); | 89 return file_system_.backend()->sync_context()->sync_status(); |
89 } | 90 } |
90 | 91 |
91 void ResetCallbackStatus() { | 92 void ResetCallbackStatus() { |
92 write_status_ = base::PLATFORM_FILE_ERROR_FAILED; | 93 write_status_ = base::PLATFORM_FILE_ERROR_FAILED; |
93 write_bytes_ = 0; | 94 write_bytes_ = 0; |
94 write_complete_ = false; | 95 write_complete_ = false; |
95 callback_count_ = 0; | 96 callback_count_ = 0; |
96 } | 97 } |
97 | 98 |
98 StatusCallback ExpectStatus(const tracked_objects::Location& location, | 99 StatusCallback ExpectStatus(const tracked_objects::Location& location, |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 file_system_.operation_runner()->Truncate( | 386 file_system_.operation_runner()->Truncate( |
386 URL(kFile), 10, | 387 URL(kFile), 10, |
387 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT)); | 388 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT)); |
388 file_system_.operation_runner()->Cancel( | 389 file_system_.operation_runner()->Cancel( |
389 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); | 390 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); |
390 base::MessageLoop::current()->RunUntilIdle(); | 391 base::MessageLoop::current()->RunUntilIdle(); |
391 EXPECT_EQ(2, callback_count_); | 392 EXPECT_EQ(2, callback_count_); |
392 } | 393 } |
393 | 394 |
394 } // namespace sync_file_system | 395 } // namespace sync_file_system |
OLD | NEW |