Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: google_apis/drive/base_requests_unittest.cc

Issue 2467133004: Correct net::EmbeddedTestServer usage in google_apis_unittests. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « google_apis/drive/base_requests_server_unittest.cc ('k') | google_apis/drive/drive_api_requests_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698