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 "google_apis/drive/base_requests.h" | 5 #include "google_apis/drive/base_requests.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 void SetUp() override { | 114 void SetUp() override { |
115 request_context_getter_ = new net::TestURLRequestContextGetter( | 115 request_context_getter_ = new net::TestURLRequestContextGetter( |
116 message_loop_.task_runner()); | 116 message_loop_.task_runner()); |
117 | 117 |
118 sender_.reset(new RequestSender(new DummyAuthService, | 118 sender_.reset(new RequestSender(new DummyAuthService, |
119 request_context_getter_.get(), | 119 request_context_getter_.get(), |
120 message_loop_.task_runner(), | 120 message_loop_.task_runner(), |
121 std::string() /* custom user agent */)); | 121 std::string() /* custom user agent */)); |
122 | 122 |
123 ASSERT_TRUE(test_server_.Start()); | |
124 test_server_.RegisterRequestHandler( | 123 test_server_.RegisterRequestHandler( |
125 base::Bind(&BaseRequestsTest::HandleRequest, base::Unretained(this))); | 124 base::Bind(&BaseRequestsTest::HandleRequest, base::Unretained(this))); |
| 125 ASSERT_TRUE(test_server_.Start()); |
126 } | 126 } |
127 | 127 |
128 std::unique_ptr<net::test_server::HttpResponse> HandleRequest( | 128 std::unique_ptr<net::test_server::HttpResponse> HandleRequest( |
129 const net::test_server::HttpRequest& request) { | 129 const net::test_server::HttpRequest& request) { |
130 std::unique_ptr<net::test_server::BasicHttpResponse> response( | 130 std::unique_ptr<net::test_server::BasicHttpResponse> response( |
131 new net::test_server::BasicHttpResponse); | 131 new net::test_server::BasicHttpResponse); |
132 response->set_code(response_code_); | 132 response->set_code(response_code_); |
133 response->set_content(response_body_); | 133 response->set_content(response_body_); |
134 response->set_content_type("application/json"); | 134 response->set_content_type("application/json"); |
135 return std::move(response); | 135 return std::move(response); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 "\n" | 225 "\n" |
226 "This is a sample file. I like chocolate and chips.\n" | 226 "This is a sample file. I like chocolate and chips.\n" |
227 "\n" | 227 "\n" |
228 "--TESTBOUNDARY--", | 228 "--TESTBOUNDARY--", |
229 upload_content_data); | 229 upload_content_data); |
230 ASSERT_EQ(HTTP_SUCCESS, error); | 230 ASSERT_EQ(HTTP_SUCCESS, error); |
231 EXPECT_EQ("file_id", file->file_id()); | 231 EXPECT_EQ("file_id", file->file_id()); |
232 } | 232 } |
233 | 233 |
234 } // Namespace google_apis | 234 } // Namespace google_apis |
OLD | NEW |