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/google_apis/fake_drive_service.h" | 5 #include "chrome/browser/google_apis/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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 int64 GetLargestChangeByAboutResource() { | 80 int64 GetLargestChangeByAboutResource() { |
81 GDataErrorCode error; | 81 GDataErrorCode error; |
82 scoped_ptr<AboutResource> about_resource; | 82 scoped_ptr<AboutResource> about_resource; |
83 fake_service_.GetAboutResource( | 83 fake_service_.GetAboutResource( |
84 test_util::CreateCopyResultCallback(&error, &about_resource)); | 84 test_util::CreateCopyResultCallback(&error, &about_resource)); |
85 message_loop_.RunUntilIdle(); | 85 message_loop_.RunUntilIdle(); |
86 return about_resource->largest_change_id(); | 86 return about_resource->largest_change_id(); |
87 } | 87 } |
88 | 88 |
89 MessageLoopForUI message_loop_; | 89 base::MessageLoopForUI message_loop_; |
90 content::TestBrowserThread ui_thread_; | 90 content::TestBrowserThread ui_thread_; |
91 FakeDriveService fake_service_; | 91 FakeDriveService fake_service_; |
92 }; | 92 }; |
93 | 93 |
94 void AppendProgressCallbackResult(std::vector<int64>* values, int64 progress) { | 94 void AppendProgressCallbackResult(std::vector<int64>* values, int64 progress) { |
95 values->push_back(progress); | 95 values->push_back(progress); |
96 } | 96 } |
97 | 97 |
98 TEST_F(FakeDriveServiceTest, GetAllResourceList) { | 98 TEST_F(FakeDriveServiceTest, GetAllResourceList) { |
99 ASSERT_TRUE(fake_service_.LoadResourceListForWapi( | 99 ASSERT_TRUE(fake_service_.LoadResourceListForWapi( |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 test_util::CreateCopyResultCallback(&error, &resource_entry)); | 1963 test_util::CreateCopyResultCallback(&error, &resource_entry)); |
1964 message_loop_.RunUntilIdle(); | 1964 message_loop_.RunUntilIdle(); |
1965 | 1965 |
1966 EXPECT_EQ(GDATA_NO_CONNECTION, error); | 1966 EXPECT_EQ(GDATA_NO_CONNECTION, error); |
1967 EXPECT_FALSE(resource_entry); | 1967 EXPECT_FALSE(resource_entry); |
1968 } | 1968 } |
1969 | 1969 |
1970 } // namespace | 1970 } // namespace |
1971 | 1971 |
1972 } // namespace google_apis | 1972 } // namespace google_apis |
OLD | NEW |