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

Side by Side Diff: chrome/test/chromedriver/net/net_util_unittest.cc

Issue 594393002: Add net::HttpServer::Delegate::OnConnect() function and set ChromeDriver buffer sizes to 100 MB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put as much of the file as possible into the anonymous namespace Created 6 years, 2 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
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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 server_url_ = base::StringPrintf("http://127.0.0.1:%d", address.port()); 63 server_url_ = base::StringPrintf("http://127.0.0.1:%d", address.port());
64 event->Signal(); 64 event->Signal();
65 } 65 }
66 66
67 void DestroyServerOnIO(base::WaitableEvent* event) { 67 void DestroyServerOnIO(base::WaitableEvent* event) {
68 server_.reset(NULL); 68 server_.reset(NULL);
69 event->Signal(); 69 event->Signal();
70 } 70 }
71 71
72 // Overridden from net::HttpServer::Delegate: 72 // Overridden from net::HttpServer::Delegate:
73 virtual void OnConnect(int connection_id) OVERRIDE {}
74
73 virtual void OnHttpRequest(int connection_id, 75 virtual void OnHttpRequest(int connection_id,
74 const net::HttpServerRequestInfo& info) OVERRIDE { 76 const net::HttpServerRequestInfo& info) OVERRIDE {
75 switch (response_) { 77 switch (response_) {
76 case kSendHello: 78 case kSendHello:
77 server_->Send200(connection_id, "hello", "text/plain"); 79 server_->Send200(connection_id, "hello", "text/plain");
78 break; 80 break;
79 case kSend404: 81 case kSend404:
80 server_->Send404(connection_id); 82 server_->Send404(connection_id);
81 break; 83 break;
82 case kClose: 84 case kClose:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ASSERT_FALSE(FetchUrl(server_url_, context_getter_.get(), &response)); 131 ASSERT_FALSE(FetchUrl(server_url_, context_getter_.get(), &response));
130 ASSERT_STREQ("stuff", response.c_str()); 132 ASSERT_STREQ("stuff", response.c_str());
131 } 133 }
132 134
133 TEST_F(FetchUrlTest, NoServer) { 135 TEST_F(FetchUrlTest, NoServer) {
134 std::string response("stuff"); 136 std::string response("stuff");
135 ASSERT_FALSE( 137 ASSERT_FALSE(
136 FetchUrl("http://localhost:33333", context_getter_.get(), &response)); 138 FetchUrl("http://localhost:33333", context_getter_.get(), &response));
137 ASSERT_STREQ("stuff", response.c_str()); 139 ASSERT_STREQ("stuff", response.c_str());
138 } 140 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/net/test_http_server.h » ('j') | chrome/test/chromedriver/net/test_http_server.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698