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 <errno.h> | 5 #include <errno.h> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 ++num_callback_invocations_; | 700 ++num_callback_invocations_; |
701 | 701 |
702 EXPECT_EQ(expected_error_, error); | 702 EXPECT_EQ(expected_error_, error); |
703 | 703 |
704 // Verify cache map. | 704 // Verify cache map. |
705 scoped_ptr<GDataCache::CacheEntry> cache_entry = | 705 scoped_ptr<GDataCache::CacheEntry> cache_entry = |
706 GetCacheEntryFromOriginThread(resource_id, md5); | 706 GetCacheEntryFromOriginThread(resource_id, md5); |
707 if (ToCacheEntry(expected_cache_state_).IsPresent() || | 707 if (ToCacheEntry(expected_cache_state_).IsPresent() || |
708 ToCacheEntry(expected_cache_state_).IsPinned()) { | 708 ToCacheEntry(expected_cache_state_).IsPinned()) { |
709 ASSERT_TRUE(cache_entry.get()); | 709 ASSERT_TRUE(cache_entry.get()); |
710 EXPECT_EQ(expected_cache_state_, cache_entry->cache_state); | 710 EXPECT_EQ(expected_cache_state_, cache_entry->cache_state()); |
711 EXPECT_EQ(expected_sub_dir_type_, cache_entry->GetSubDirectoryType()); | 711 EXPECT_EQ(expected_sub_dir_type_, cache_entry->GetSubDirectoryType()); |
712 } else { | 712 } else { |
713 EXPECT_FALSE(cache_entry.get()); | 713 EXPECT_FALSE(cache_entry.get()); |
714 } | 714 } |
715 | 715 |
716 // Verify actual cache file. | 716 // Verify actual cache file. |
717 FilePath dest_path = cache_->GetCacheFilePath( | 717 FilePath dest_path = cache_->GetCacheFilePath( |
718 resource_id, | 718 resource_id, |
719 md5, | 719 md5, |
720 ToCacheEntry(expected_cache_state_).IsPinned() || | 720 ToCacheEntry(expected_cache_state_).IsPinned() || |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2631 | 2631 |
2632 // Try to close the same file twice. | 2632 // Try to close the same file twice. |
2633 file_system_->CloseFile(kFileInRoot, close_file_callback); | 2633 file_system_->CloseFile(kFileInRoot, close_file_callback); |
2634 message_loop_.Run(); | 2634 message_loop_.Run(); |
2635 | 2635 |
2636 // It must fail. | 2636 // It must fail. |
2637 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); | 2637 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); |
2638 } | 2638 } |
2639 | 2639 |
2640 } // namespace gdata | 2640 } // namespace gdata |
OLD | NEW |