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

Side by Side Diff: net/test/embedded_test_server/embedded_test_server_unittest.cc

Issue 1881463003: Add a browsertest suite for net predictor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT that we get the right number of accepted connections after waiting Created 4 years, 7 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/test/embedded_test_server/embedded_test_server_connection_listener.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/test/embedded_test_server/embedded_test_server.h" 5 #include "net/test/embedded_test_server/embedded_test_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Get called from the EmbeddedTestServer thread to be notified that 76 // Get called from the EmbeddedTestServer thread to be notified that
77 // a connection was accepted. 77 // a connection was accepted.
78 void AcceptedSocket(const net::StreamSocket& connection) override { 78 void AcceptedSocket(const net::StreamSocket& connection) override {
79 base::AutoLock lock(lock_); 79 base::AutoLock lock(lock_);
80 ++socket_accepted_count_; 80 ++socket_accepted_count_;
81 task_runner_->PostTask(FROM_HERE, accept_loop_.QuitClosure()); 81 task_runner_->PostTask(FROM_HERE, accept_loop_.QuitClosure());
82 } 82 }
83 83
84 // Get called from the EmbeddedTestServer thread to be notified that 84 // Get called from the EmbeddedTestServer thread to be notified that
85 // a connection was read from. 85 // a connection was read from.
86 void ReadFromSocket(const net::StreamSocket& connection) override { 86 void ReadFromSocket(const net::StreamSocket& connection, int rv) override {
87 base::AutoLock lock(lock_); 87 base::AutoLock lock(lock_);
88 did_read_from_socket_ = true; 88 did_read_from_socket_ = true;
89 } 89 }
90 90
91 void WaitUntilFirstConnectionAccepted() { accept_loop_.Run(); } 91 void WaitUntilFirstConnectionAccepted() { accept_loop_.Run(); }
92 92
93 size_t SocketAcceptedCount() const { 93 size_t SocketAcceptedCount() const {
94 base::AutoLock lock(lock_); 94 base::AutoLock lock(lock_);
95 return socket_accepted_count_; 95 return socket_accepted_count_;
96 } 96 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 INSTANTIATE_TEST_CASE_P( 593 INSTANTIATE_TEST_CASE_P(
594 EmbeddedTestServerThreadingTestInstantiation, 594 EmbeddedTestServerThreadingTestInstantiation,
595 EmbeddedTestServerThreadingTest, 595 EmbeddedTestServerThreadingTest,
596 testing::Combine(testing::Bool(), 596 testing::Combine(testing::Bool(),
597 testing::Bool(), 597 testing::Bool(),
598 testing::Values(EmbeddedTestServer::TYPE_HTTP, 598 testing::Values(EmbeddedTestServer::TYPE_HTTP,
599 EmbeddedTestServer::TYPE_HTTPS))); 599 EmbeddedTestServer::TYPE_HTTPS)));
600 600
601 } // namespace test_server 601 } // namespace test_server
602 } // namespace net 602 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server_connection_listener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698