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/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 GDataErrorCode error, | 46 GDataErrorCode error, |
47 scoped_ptr<std::string> content) { | 47 scoped_ptr<std::string> content) { |
48 EXPECT_EQ(HTTP_SUCCESS, error); | 48 EXPECT_EQ(HTTP_SUCCESS, error); |
49 out->append(*content); | 49 out->append(*content); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 class DriveApiRequestsTest : public testing::Test { | 54 class DriveApiRequestsTest : public testing::Test { |
55 public: | 55 public: |
56 DriveApiRequestsTest() | 56 DriveApiRequestsTest() { |
57 : test_server_(message_loop_.message_loop_proxy()) { | |
58 } | 57 } |
59 | 58 |
60 virtual void SetUp() OVERRIDE { | 59 virtual void SetUp() OVERRIDE { |
61 request_context_getter_ = new net::TestURLRequestContextGetter( | 60 request_context_getter_ = new net::TestURLRequestContextGetter( |
62 message_loop_.message_loop_proxy()); | 61 message_loop_.message_loop_proxy()); |
63 | 62 |
64 request_sender_.reset(new RequestSender(new DummyAuthService, | 63 request_sender_.reset(new RequestSender(new DummyAuthService, |
65 request_context_getter_.get(), | 64 request_context_getter_.get(), |
66 message_loop_.message_loop_proxy(), | 65 message_loop_.message_loop_proxy(), |
67 kTestUserAgent)); | 66 kTestUserAgent)); |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 EXPECT_EQ(HTTP_SUCCESS, result_code); | 1591 EXPECT_EQ(HTTP_SUCCESS, result_code); |
1593 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); | 1592 EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); |
1594 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); | 1593 EXPECT_EQ(kTestDownloadPathPrefix + kTestId, http_request_.relative_url); |
1595 EXPECT_EQ(kDownloadedFilePath, temp_file); | 1594 EXPECT_EQ(kDownloadedFilePath, temp_file); |
1596 | 1595 |
1597 const std::string expected_contents = kTestId + kTestId + kTestId; | 1596 const std::string expected_contents = kTestId + kTestId + kTestId; |
1598 EXPECT_EQ(expected_contents, contents); | 1597 EXPECT_EQ(expected_contents, contents); |
1599 } | 1598 } |
1600 | 1599 |
1601 } // namespace google_apis | 1600 } // namespace google_apis |
OLD | NEW |