| 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/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" | 13 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" |
| 14 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" | 14 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
| 15 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 15 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
| 16 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" | 16 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" |
| 17 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 17 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
| 18 #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
" | 18 #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
" |
| 19 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h
" | 19 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h
" |
| 20 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 20 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
| 21 #include "content/public/test/mock_blob_url_request_context.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "webkit/browser/blob/mock_blob_url_request_context.h" | |
| 24 #include "webkit/browser/fileapi/file_system_context.h" | 24 #include "webkit/browser/fileapi/file_system_context.h" |
| 25 #include "webkit/browser/fileapi/file_system_operation_runner.h" | 25 #include "webkit/browser/fileapi/file_system_operation_runner.h" |
| 26 | 26 |
| 27 using fileapi::FileSystemOperation; | 27 using fileapi::FileSystemOperation; |
| 28 using fileapi::FileSystemURL; | 28 using fileapi::FileSystemURL; |
| 29 using webkit_blob::MockBlobURLRequestContext; | 29 using content::MockBlobURLRequestContext; |
| 30 using webkit_blob::ScopedTextBlob; | 30 using content::ScopedTextBlob; |
| 31 using base::File; | 31 using base::File; |
| 32 | 32 |
| 33 namespace sync_file_system { | 33 namespace sync_file_system { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 const std::string kParent = "foo"; | 36 const std::string kParent = "foo"; |
| 37 const std::string kFile = "foo/file"; | 37 const std::string kFile = "foo/file"; |
| 38 const std::string kDir = "foo/dir"; | 38 const std::string kDir = "foo/dir"; |
| 39 const std::string kChild = "foo/dir/bar"; | 39 const std::string kChild = "foo/dir/bar"; |
| 40 const std::string kOther = "bar"; | 40 const std::string kOther = "bar"; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 file_system_.operation_runner()->Truncate( | 392 file_system_.operation_runner()->Truncate( |
| 393 URL(kFile), 10, | 393 URL(kFile), 10, |
| 394 ExpectStatus(FROM_HERE, File::FILE_OK)); | 394 ExpectStatus(FROM_HERE, File::FILE_OK)); |
| 395 file_system_.operation_runner()->Cancel( | 395 file_system_.operation_runner()->Cancel( |
| 396 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); | 396 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); |
| 397 base::MessageLoop::current()->RunUntilIdle(); | 397 base::MessageLoop::current()->RunUntilIdle(); |
| 398 EXPECT_EQ(2, callback_count_); | 398 EXPECT_EQ(2, callback_count_); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace sync_file_system | 401 } // namespace sync_file_system |
| OLD | NEW |