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

Side by Side Diff: net/server/http_server_unittest.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months 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
« no previous file with comments | « net/server/http_server.cc ('k') | net/server/web_socket_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 class HttpServerTest : public testing::Test, 183 class HttpServerTest : public testing::Test,
184 public HttpServer::Delegate { 184 public HttpServer::Delegate {
185 public: 185 public:
186 HttpServerTest() : quit_after_request_count_(0) {} 186 HttpServerTest() : quit_after_request_count_(0) {}
187 187
188 void SetUp() override { 188 void SetUp() override {
189 scoped_ptr<ServerSocket> server_socket( 189 scoped_ptr<ServerSocket> server_socket(
190 new TCPServerSocket(NULL, NetLog::Source())); 190 new TCPServerSocket(NULL, NetLog::Source()));
191 server_socket->ListenWithAddressAndPort("127.0.0.1", 0, 1); 191 server_socket->ListenWithAddressAndPort("127.0.0.1", 0, 1);
192 server_.reset(new HttpServer(server_socket.Pass(), this)); 192 server_.reset(new HttpServer(std::move(server_socket), this));
193 ASSERT_EQ(OK, server_->GetLocalAddress(&server_address_)); 193 ASSERT_EQ(OK, server_->GetLocalAddress(&server_address_));
194 } 194 }
195 195
196 void OnConnect(int connection_id) override {} 196 void OnConnect(int connection_id) override {}
197 197
198 void OnHttpRequest(int connection_id, 198 void OnHttpRequest(int connection_id,
199 const HttpServerRequestInfo& info) override { 199 const HttpServerRequestInfo& info) override {
200 requests_.push_back(std::make_pair(info, connection_id)); 200 requests_.push_back(std::make_pair(info, connection_id));
201 if (requests_.size() == quit_after_request_count_) 201 if (requests_.size() == quit_after_request_count_)
202 run_loop_quit_func_.Run(); 202 run_loop_quit_func_.Run();
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 ASSERT_EQ(OK, client.ConnectAndWait(server_address_)); 649 ASSERT_EQ(OK, client.ConnectAndWait(server_address_));
650 client.Send("GET / HTTP/1.1\r\n\r\n"); 650 client.Send("GET / HTTP/1.1\r\n\r\n");
651 ASSERT_FALSE(RunUntilRequestsReceived(1)); 651 ASSERT_FALSE(RunUntilRequestsReceived(1));
652 ASSERT_EQ(1ul, connection_ids_.size()); 652 ASSERT_EQ(1ul, connection_ids_.size());
653 ASSERT_EQ(0ul, requests_.size()); 653 ASSERT_EQ(0ul, requests_.size());
654 } 654 }
655 655
656 } // namespace 656 } // namespace
657 657
658 } // namespace net 658 } // namespace net
OLDNEW
« no previous file with comments | « net/server/http_server.cc ('k') | net/server/web_socket_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698