OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 ASSERT_TRUE(about_resource.get()); | 562 ASSERT_TRUE(about_resource.get()); |
563 EXPECT_EQ(expected->largest_change_id(), about_resource->largest_change_id()); | 563 EXPECT_EQ(expected->largest_change_id(), about_resource->largest_change_id()); |
564 EXPECT_EQ(expected->quota_bytes_total(), about_resource->quota_bytes_total()); | 564 EXPECT_EQ(expected->quota_bytes_total(), about_resource->quota_bytes_total()); |
565 EXPECT_EQ(expected->quota_bytes_used(), about_resource->quota_bytes_used()); | 565 EXPECT_EQ(expected->quota_bytes_used(), about_resource->quota_bytes_used()); |
566 EXPECT_EQ(expected->root_folder_id(), about_resource->root_folder_id()); | 566 EXPECT_EQ(expected->root_folder_id(), about_resource->root_folder_id()); |
567 } | 567 } |
568 | 568 |
569 TEST_F(DriveApiRequestsTest, AboutGetRequest_InvalidJson) { | 569 TEST_F(DriveApiRequestsTest, AboutGetRequest_InvalidJson) { |
570 // Set an expected data file containing invalid result. | 570 // Set an expected data file containing invalid result. |
571 expected_data_file_path_ = test_util::GetTestFilePath( | 571 expected_data_file_path_ = test_util::GetTestFilePath( |
572 "gdata/testfile.txt"); | 572 "drive/testfile.txt"); |
573 | 573 |
574 GDataErrorCode error = GDATA_OTHER_ERROR; | 574 GDataErrorCode error = GDATA_OTHER_ERROR; |
575 scoped_ptr<AboutResource> about_resource; | 575 scoped_ptr<AboutResource> about_resource; |
576 | 576 |
577 { | 577 { |
578 base::RunLoop run_loop; | 578 base::RunLoop run_loop; |
579 drive::AboutGetRequest* request = new drive::AboutGetRequest( | 579 drive::AboutGetRequest* request = new drive::AboutGetRequest( |
580 request_sender_.get(), | 580 request_sender_.get(), |
581 *url_generator_, | 581 *url_generator_, |
582 test_util::CreateQuitCallback( | 582 test_util::CreateQuitCallback( |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 expected.reset(base::JSONReader::Read( | 1846 expected.reset(base::JSONReader::Read( |
1847 "{\"role\":\"writer\", \"type\":\"domain\",\"value\":\"example.com\"}")); | 1847 "{\"role\":\"writer\", \"type\":\"domain\",\"value\":\"example.com\"}")); |
1848 ASSERT_TRUE(expected); | 1848 ASSERT_TRUE(expected); |
1849 | 1849 |
1850 result.reset(base::JSONReader::Read(http_request_.content)); | 1850 result.reset(base::JSONReader::Read(http_request_.content)); |
1851 EXPECT_TRUE(http_request_.has_content); | 1851 EXPECT_TRUE(http_request_.has_content); |
1852 EXPECT_TRUE(base::Value::Equals(expected.get(), result.get())); | 1852 EXPECT_TRUE(base::Value::Equals(expected.get(), result.get())); |
1853 } | 1853 } |
1854 | 1854 |
1855 } // namespace google_apis | 1855 } // namespace google_apis |
OLD | NEW |