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/file_cache.h" | 5 #include "chrome/browser/chromeos/drive/file_cache.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 const std::string& resource_id, | 329 const std::string& resource_id, |
330 const std::string& md5, | 330 const std::string& md5, |
331 FileError expected_error, | 331 FileError expected_error, |
332 int expected_cache_state, | 332 int expected_cache_state, |
333 FileCache::CacheSubDirectoryType expected_sub_dir_type) { | 333 FileCache::CacheSubDirectoryType expected_sub_dir_type) { |
334 expected_error_ = expected_error; | 334 expected_error_ = expected_error; |
335 expected_cache_state_ = expected_cache_state; | 335 expected_cache_state_ = expected_cache_state; |
336 expected_sub_dir_type_ = expected_sub_dir_type; | 336 expected_sub_dir_type_ = expected_sub_dir_type; |
337 | 337 |
338 FileError error = FILE_ERROR_OK; | 338 FileError error = FILE_ERROR_OK; |
339 cache_->ClearDirtyOnUIThread( | 339 PostTaskAndReplyWithResult( |
340 resource_id, md5, | 340 blocking_task_runner_, |
| 341 FROM_HERE, |
| 342 base::Bind(&FileCache::ClearDirty, |
| 343 base::Unretained(cache_.get()), |
| 344 resource_id, md5), |
341 google_apis::test_util::CreateCopyResultCallback(&error)); | 345 google_apis::test_util::CreateCopyResultCallback(&error)); |
342 google_apis::test_util::RunBlockingPoolTask(); | 346 google_apis::test_util::RunBlockingPoolTask(); |
343 VerifyCacheFileState(error, resource_id, md5); | 347 VerifyCacheFileState(error, resource_id, md5); |
344 } | 348 } |
345 | 349 |
346 void TestMarkAsMounted( | 350 void TestMarkAsMounted( |
347 const std::string& resource_id, | 351 const std::string& resource_id, |
348 const std::string& md5, | 352 const std::string& md5, |
349 FileError expected_error, | 353 FileError expected_error, |
350 int expected_cache_state, | 354 int expected_cache_state, |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 google_apis::test_util::GetTestFilePath("chromeos/gdata/empty_feed.json"), | 1316 google_apis::test_util::GetTestFilePath("chromeos/gdata/empty_feed.json"), |
1313 FILE_ERROR_OK, | 1317 FILE_ERROR_OK, |
1314 test_util::TEST_CACHE_STATE_PRESENT | | 1318 test_util::TEST_CACHE_STATE_PRESENT | |
1315 test_util::TEST_CACHE_STATE_PINNED | | 1319 test_util::TEST_CACHE_STATE_PINNED | |
1316 test_util::TEST_CACHE_STATE_PERSISTENT, | 1320 test_util::TEST_CACHE_STATE_PERSISTENT, |
1317 FileCache::CACHE_TYPE_PERSISTENT); | 1321 FileCache::CACHE_TYPE_PERSISTENT); |
1318 } | 1322 } |
1319 | 1323 |
1320 } // namespace internal | 1324 } // namespace internal |
1321 } // namespace drive | 1325 } // namespace drive |
OLD | NEW |