| 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 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 false, // shared_with_me | 218 false, // shared_with_me |
| 219 fake_service_.GetRootResourceId(), // directory_resource_id | 219 fake_service_.GetRootResourceId(), // directory_resource_id |
| 220 base::Bind(&test_util::CopyResultsFromGetResourceListCallback, | 220 base::Bind(&test_util::CopyResultsFromGetResourceListCallback, |
| 221 &error, | 221 &error, |
| 222 &resource_list)); | 222 &resource_list)); |
| 223 message_loop_.RunUntilIdle(); | 223 message_loop_.RunUntilIdle(); |
| 224 | 224 |
| 225 EXPECT_EQ(HTTP_SUCCESS, error); | 225 EXPECT_EQ(HTTP_SUCCESS, error); |
| 226 ASSERT_TRUE(resource_list); | 226 ASSERT_TRUE(resource_list); |
| 227 // Do some sanity check. There are 7 entries in the root directory. | 227 // Do some sanity check. There are 7 entries in the root directory. |
| 228 EXPECT_EQ(7U, resource_list->entries().size()); | 228 EXPECT_EQ(8U, resource_list->entries().size()); |
| 229 EXPECT_EQ(1, fake_service_.resource_list_load_count()); | 229 EXPECT_EQ(1, fake_service_.resource_list_load_count()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 TEST_F(FakeDriveServiceTest, GetResourceList_Search) { | 232 TEST_F(FakeDriveServiceTest, GetResourceList_Search) { |
| 233 ASSERT_TRUE(fake_service_.LoadResourceListForWapi( | 233 ASSERT_TRUE(fake_service_.LoadResourceListForWapi( |
| 234 "chromeos/gdata/root_feed.json")); | 234 "chromeos/gdata/root_feed.json")); |
| 235 | 235 |
| 236 GDataErrorCode error = GDATA_OTHER_ERROR; | 236 GDataErrorCode error = GDATA_OTHER_ERROR; |
| 237 scoped_ptr<ResourceList> resource_list; | 237 scoped_ptr<ResourceList> resource_list; |
| 238 fake_service_.GetResourceList( | 238 fake_service_.GetResourceList( |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 | 1535 |
| 1536 EXPECT_EQ(HTTP_CREATED, response.code); | 1536 EXPECT_EQ(HTTP_CREATED, response.code); |
| 1537 EXPECT_TRUE(entry.get()); | 1537 EXPECT_TRUE(entry.get()); |
| 1538 EXPECT_EQ(15L, entry->file_size()); | 1538 EXPECT_EQ(15L, entry->file_size()); |
| 1539 EXPECT_TRUE(Exists(entry->resource_id())); | 1539 EXPECT_TRUE(Exists(entry->resource_id())); |
| 1540 } | 1540 } |
| 1541 | 1541 |
| 1542 } // namespace | 1542 } // namespace |
| 1543 | 1543 |
| 1544 } // namespace google_apis | 1544 } // namespace google_apis |
| OLD | NEW |