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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 GetContentCallback(), | 1580 GetContentCallback(), |
1581 ProgressCallback(), | 1581 ProgressCallback(), |
1582 kTestIdWithTypeLabel, | 1582 kTestIdWithTypeLabel, |
1583 kDownloadedFilePath); | 1583 kDownloadedFilePath); |
1584 request_sender_->StartRequestWithRetry(request); | 1584 request_sender_->StartRequestWithRetry(request); |
1585 run_loop.Run(); | 1585 run_loop.Run(); |
1586 } | 1586 } |
1587 | 1587 |
1588 std::string contents; | 1588 std::string contents; |
1589 file_util::ReadFileToString(temp_file, &contents); | 1589 file_util::ReadFileToString(temp_file, &contents); |
1590 base::Delete(temp_file, false); | 1590 base::DeleteFile(temp_file, false); |
1591 | 1591 |
1592 EXPECT_EQ(HTTP_SUCCESS, result_code); | 1592 EXPECT_EQ(HTTP_SUCCESS, result_code); |
1593 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); | 1593 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); |
1594 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); | 1594 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); |
1595 EXPECT_EQ(kDownloadedFilePath, temp_file); | 1595 EXPECT_EQ(kDownloadedFilePath, temp_file); |
1596 | 1596 |
1597 const std::string expected_contents = kTestId + kTestId + kTestId; | 1597 const std::string expected_contents = kTestId + kTestId + kTestId; |
1598 EXPECT_EQ(expected_contents, contents); | 1598 EXPECT_EQ(expected_contents, contents); |
1599 } | 1599 } |
1600 | 1600 |
1601 } // namespace google_apis | 1601 } // namespace google_apis |
OLD | NEW |