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 3645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3656 GDataRootDirectory::CACHE_TYPE_TMP); | 3656 GDataRootDirectory::CACHE_TYPE_TMP); |
3657 EXPECT_EQ(1, num_callback_invocations_); | 3657 EXPECT_EQ(1, num_callback_invocations_); |
3658 EXPECT_TRUE(CacheEntryExists(resource_id, md5)); | 3658 EXPECT_TRUE(CacheEntryExists(resource_id, md5)); |
3659 | 3659 |
3660 // Try to remove the file. | 3660 // Try to remove the file. |
3661 num_callback_invocations_ = 0; | 3661 num_callback_invocations_ = 0; |
3662 TestRemoveFromCache(resource_id, base::PLATFORM_FILE_OK); | 3662 TestRemoveFromCache(resource_id, base::PLATFORM_FILE_OK); |
3663 EXPECT_EQ(1, num_callback_invocations_); | 3663 EXPECT_EQ(1, num_callback_invocations_); |
3664 } | 3664 } |
3665 | 3665 |
3666 TEST_F(GDataFileSystemTest, RequestDirectoryRefresh) { | |
3667 // We'll fetch documents in the root directory with its resource ID. | |
3668 EXPECT_CALL(*mock_doc_service_, | |
3669 GetDocuments(Eq(GURL()), _, _, kGDataRootDirectoryResourceId, _)) | |
3670 .Times(1); | |
3671 // We'll notify the directory change to the observer. | |
3672 EXPECT_CALL(*mock_directory_observer_, | |
3673 OnDirectoryChanged(Eq(FilePath(kGDataRootDirectory)))).Times(1); | |
3674 | |
3675 file_system_->RequestDirectoryRefresh(FilePath(kGDataRootDirectory)); | |
3676 message_loop_.RunAllPending(); | |
3677 } | |
3678 | |
3679 } // namespace gdata | 3666 } // namespace gdata |
OLD | NEW |