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 "chrome/browser/sync_file_system/drive_backend_v1/fake_api_util.h" | 5 #include "chrome/browser/sync_file_system/drive_backend_v1/fake_api_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "google_apis/drive/gdata_errorcode.h" | 12 #include "google_apis/drive/gdata_errorcode.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "webkit/common/blob/scoped_file.h" | 14 #include "storage/common/blob/scoped_file.h" |
15 | 15 |
16 namespace sync_file_system { | 16 namespace sync_file_system { |
17 namespace drive_backend { | 17 namespace drive_backend { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 void DidDownloadFile(google_apis::GDataErrorCode* error_out, | 21 void DidDownloadFile(google_apis::GDataErrorCode* error_out, |
22 std::string* file_md5_out, | 22 std::string* file_md5_out, |
23 google_apis::GDataErrorCode error, | 23 google_apis::GDataErrorCode error, |
24 const std::string& file_md5, | 24 const std::string& file_md5, |
25 int64 file_size, | 25 int64 file_size, |
26 const base::Time& updated_time, | 26 const base::Time& updated_time, |
27 webkit_blob::ScopedFile downloaded_file) { | 27 storage::ScopedFile downloaded_file) { |
28 *error_out = error; | 28 *error_out = error; |
29 *file_md5_out = file_md5; | 29 *file_md5_out = file_md5; |
30 } | 30 } |
31 | 31 |
32 void DidGetChangeList(google_apis::GDataErrorCode* error_out, | 32 void DidGetChangeList(google_apis::GDataErrorCode* error_out, |
33 scoped_ptr<google_apis::ResourceList>* change_list_out, | 33 scoped_ptr<google_apis::ResourceList>* change_list_out, |
34 google_apis::GDataErrorCode error, | 34 google_apis::GDataErrorCode error, |
35 scoped_ptr<google_apis::ResourceList> change_list) { | 35 scoped_ptr<google_apis::ResourceList> change_list) { |
36 *error_out = error; | 36 *error_out = error; |
37 *change_list_out = change_list.Pass(); | 37 *change_list_out = change_list.Pass(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 api_util.DeleteFile( | 132 api_util.DeleteFile( |
133 resource_id, std::string(), base::Bind(&DidDeleteFile, &error)); | 133 resource_id, std::string(), base::Bind(&DidDeleteFile, &error)); |
134 message_loop.RunUntilIdle(); | 134 message_loop.RunUntilIdle(); |
135 | 135 |
136 EXPECT_EQ(google_apis::HTTP_SUCCESS, error); | 136 EXPECT_EQ(google_apis::HTTP_SUCCESS, error); |
137 EXPECT_TRUE(api_util.remote_resources().find(resource_id)->second.deleted); | 137 EXPECT_TRUE(api_util.remote_resources().find(resource_id)->second.deleted); |
138 } | 138 } |
139 | 139 |
140 } // namespace drive_backend | 140 } // namespace drive_backend |
141 } // namespace sync_file_system | 141 } // namespace sync_file_system |
OLD | NEW |