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 <algorithm> | 5 #include <algorithm> |
6 #include <map> | 6 #include <map> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 test_util::CreateCopyResultCallback(&result_code, &temp_file)), | 1573 test_util::CreateCopyResultCallback(&result_code, &temp_file)), |
1574 GetContentCallback(), | 1574 GetContentCallback(), |
1575 ProgressCallback(), | 1575 ProgressCallback(), |
1576 kTestIdWithTypeLabel, | 1576 kTestIdWithTypeLabel, |
1577 kDownloadedFilePath); | 1577 kDownloadedFilePath); |
1578 request_sender_->StartRequestWithRetry(request); | 1578 request_sender_->StartRequestWithRetry(request); |
1579 run_loop.Run(); | 1579 run_loop.Run(); |
1580 } | 1580 } |
1581 | 1581 |
1582 std::string contents; | 1582 std::string contents; |
1583 file_util::ReadFileToString(temp_file, &contents); | 1583 base::ReadFileToString(temp_file, &contents); |
1584 base::DeleteFile(temp_file, false); | 1584 base::DeleteFile(temp_file, false); |
1585 | 1585 |
1586 EXPECT_EQ(HTTP_SUCCESS, result_code); | 1586 EXPECT_EQ(HTTP_SUCCESS, result_code); |
1587 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); | 1587 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); |
1588 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); | 1588 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); |
1589 EXPECT_EQ(kDownloadedFilePath, temp_file); | 1589 EXPECT_EQ(kDownloadedFilePath, temp_file); |
1590 | 1590 |
1591 const std::string expected_contents = kTestId + kTestId + kTestId; | 1591 const std::string expected_contents = kTestId + kTestId + kTestId; |
1592 EXPECT_EQ(expected_contents, contents); | 1592 EXPECT_EQ(expected_contents, contents); |
1593 } | 1593 } |
1594 | 1594 |
1595 } // namespace google_apis | 1595 } // namespace google_apis |
OLD | NEW |