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/drive/fake_drive_service.h" | 5 #include "chrome/browser/drive/fake_drive_service.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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 | 731 |
732 GDataErrorCode error = GDATA_OTHER_ERROR; | 732 GDataErrorCode error = GDATA_OTHER_ERROR; |
733 scoped_ptr<AppList> app_list; | 733 scoped_ptr<AppList> app_list; |
734 fake_service_.GetAppList( | 734 fake_service_.GetAppList( |
735 test_util::CreateCopyResultCallback(&error, &app_list)); | 735 test_util::CreateCopyResultCallback(&error, &app_list)); |
736 base::RunLoop().RunUntilIdle(); | 736 base::RunLoop().RunUntilIdle(); |
737 | 737 |
738 EXPECT_EQ(HTTP_SUCCESS, error); | 738 EXPECT_EQ(HTTP_SUCCESS, error); |
739 | 739 |
740 ASSERT_TRUE(app_list); | 740 ASSERT_TRUE(app_list); |
| 741 EXPECT_EQ(1, fake_service_.app_list_load_count()); |
741 } | 742 } |
742 | 743 |
743 TEST_F(FakeDriveServiceTest, GetAppList_Offline) { | 744 TEST_F(FakeDriveServiceTest, GetAppList_Offline) { |
744 ASSERT_TRUE(fake_service_.LoadAppListForDriveApi( | 745 ASSERT_TRUE(fake_service_.LoadAppListForDriveApi( |
745 "drive/applist.json")); | 746 "drive/applist.json")); |
746 fake_service_.set_offline(true); | 747 fake_service_.set_offline(true); |
747 | 748 |
748 GDataErrorCode error = GDATA_OTHER_ERROR; | 749 GDataErrorCode error = GDATA_OTHER_ERROR; |
749 scoped_ptr<AppList> app_list; | 750 scoped_ptr<AppList> app_list; |
750 fake_service_.GetAppList( | 751 fake_service_.GetAppList( |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 test_util::CreateCopyResultCallback(&error, &resource_entry)); | 2184 test_util::CreateCopyResultCallback(&error, &resource_entry)); |
2184 base::RunLoop().RunUntilIdle(); | 2185 base::RunLoop().RunUntilIdle(); |
2185 | 2186 |
2186 EXPECT_EQ(GDATA_NO_CONNECTION, error); | 2187 EXPECT_EQ(GDATA_NO_CONNECTION, error); |
2187 EXPECT_FALSE(resource_entry); | 2188 EXPECT_FALSE(resource_entry); |
2188 } | 2189 } |
2189 | 2190 |
2190 } // namespace | 2191 } // namespace |
2191 | 2192 |
2192 } // namespace drive | 2193 } // namespace drive |
OLD | NEW |