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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 void DidFinish(const tracked_objects::Location& location, | 121 void DidFinish(const tracked_objects::Location& location, |
122 PlatformFileError expect, PlatformFileError status) { | 122 PlatformFileError expect, PlatformFileError status) { |
123 SCOPED_TRACE(testing::Message() << location.ToString()); | 123 SCOPED_TRACE(testing::Message() << location.ToString()); |
124 EXPECT_EQ(expect, status); | 124 EXPECT_EQ(expect, status); |
125 ++callback_count_; | 125 ++callback_count_; |
126 } | 126 } |
127 | 127 |
128 bool CreateTempFile(base::FilePath* path) { | 128 bool CreateTempFile(base::FilePath* path) { |
129 return file_util::CreateTemporaryFileInDir(dir_.path(), path); | 129 return base::CreateTemporaryFileInDir(dir_.path(), path); |
130 } | 130 } |
131 | 131 |
132 ScopedEnableSyncFSDirectoryOperation enable_directory_operation_; | 132 ScopedEnableSyncFSDirectoryOperation enable_directory_operation_; |
133 base::ScopedTempDir dir_; | 133 base::ScopedTempDir dir_; |
134 | 134 |
135 content::TestBrowserThreadBundle thread_bundle_; | 135 content::TestBrowserThreadBundle thread_bundle_; |
136 CannedSyncableFileSystem file_system_; | 136 CannedSyncableFileSystem file_system_; |
137 scoped_refptr<LocalFileSyncContext> sync_context_; | 137 scoped_refptr<LocalFileSyncContext> sync_context_; |
138 | 138 |
139 int callback_count_; | 139 int callback_count_; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 file_system_.operation_runner()->Truncate( | 391 file_system_.operation_runner()->Truncate( |
392 URL(kFile), 10, | 392 URL(kFile), 10, |
393 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); | 393 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); |
394 file_system_.operation_runner()->Cancel( | 394 file_system_.operation_runner()->Cancel( |
395 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_INVALID_OPERATION)); | 395 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_INVALID_OPERATION)); |
396 base::MessageLoop::current()->RunUntilIdle(); | 396 base::MessageLoop::current()->RunUntilIdle(); |
397 EXPECT_EQ(2, callback_count_); | 397 EXPECT_EQ(2, callback_count_); |
398 } | 398 } |
399 | 399 |
400 } // namespace sync_file_system | 400 } // namespace sync_file_system |
OLD | NEW |