OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/drive/drive_test_util.h" | 5 #include "chrome/browser/chromeos/drive/drive_test_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/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 return false; | 211 return false; |
212 | 212 |
213 scoped_ptr<google_apis::ResourceList> document_feed( | 213 scoped_ptr<google_apis::ResourceList> document_feed( |
214 google_apis::ResourceList::ExtractAndParse(*document)); | 214 google_apis::ResourceList::ExtractAndParse(*document)); |
215 if (!document_feed.get()) | 215 if (!document_feed.get()) |
216 return false; | 216 return false; |
217 | 217 |
218 ScopedVector<google_apis::ResourceList> feed_list; | 218 ScopedVector<google_apis::ResourceList> feed_list; |
219 feed_list.push_back(document_feed.release()); | 219 feed_list.push_back(document_feed.release()); |
220 | 220 |
221 scoped_ptr<google_apis::AboutResource> about_resource( | |
222 new google_apis::AboutResource); | |
223 about_resource->set_largest_change_id(root_feed_changestamp); | |
224 about_resource->set_root_folder_id("fake_root"); | |
hidehiko
2013/03/18 06:22:27
Let's avoid hard-coded root id of the fake server.
Haruki Sato
2013/03/18 07:06:41
Done. Thanks. This is what you meant, right?
| |
225 | |
221 change_list_loader->UpdateFromFeed( | 226 change_list_loader->UpdateFromFeed( |
227 about_resource.Pass(), | |
222 feed_list, | 228 feed_list, |
223 is_delta_feed, | 229 is_delta_feed, |
224 root_feed_changestamp, | |
225 base::Bind(&base::DoNothing)); | 230 base::Bind(&base::DoNothing)); |
226 // ChangeListLoader::UpdateFromFeed is asynchronous, so wait for it to finish. | 231 // ChangeListLoader::UpdateFromFeed is asynchronous, so wait for it to finish. |
227 google_apis::test_util::RunBlockingPoolTask(); | 232 google_apis::test_util::RunBlockingPoolTask(); |
228 | 233 |
229 return true; | 234 return true; |
230 } | 235 } |
231 | 236 |
232 void DeleteDriveCache(DriveCache* drive_cache) { | 237 void DeleteDriveCache(DriveCache* drive_cache) { |
233 DCHECK(drive_cache); | 238 DCHECK(drive_cache); |
234 drive_cache->Destroy(); | 239 drive_cache->Destroy(); |
235 // The cache destruction requires to post a task to the blocking pool. | 240 // The cache destruction requires to post a task to the blocking pool. |
236 google_apis::test_util::RunBlockingPoolTask(); | 241 google_apis::test_util::RunBlockingPoolTask(); |
237 } | 242 } |
238 | 243 |
239 } // namespace test_util | 244 } // namespace test_util |
240 } // namespace drive | 245 } // namespace drive |
OLD | NEW |