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

Side by Side Diff: net/socket/websocket_endpoint_lock_manager_unittest.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/socket/websocket_endpoint_lock_manager.h" 5 #include "net/socket/websocket_endpoint_lock_manager.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/socket/next_proto.h" 8 #include "net/socket/next_proto.h"
9 #include "net/socket/socket_test_util.h" 9 #include "net/socket/socket_test_util.h"
10 #include "net/socket/stream_socket.h" 10 #include "net/socket/stream_socket.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool called() const { return called_; } 86 bool called() const { return called_; }
87 87
88 private: 88 private:
89 bool called_; 89 bool called_;
90 }; 90 };
91 91
92 class WebSocketEndpointLockManagerTest : public ::testing::Test { 92 class WebSocketEndpointLockManagerTest : public ::testing::Test {
93 protected: 93 protected:
94 WebSocketEndpointLockManagerTest() 94 WebSocketEndpointLockManagerTest()
95 : instance_(WebSocketEndpointLockManager::GetInstance()) {} 95 : instance_(WebSocketEndpointLockManager::GetInstance()) {}
96 virtual ~WebSocketEndpointLockManagerTest() { 96 ~WebSocketEndpointLockManagerTest() override {
97 // If this check fails then subsequent tests may fail. 97 // If this check fails then subsequent tests may fail.
98 CHECK(instance_->IsEmpty()); 98 CHECK(instance_->IsEmpty());
99 } 99 }
100 100
101 WebSocketEndpointLockManager* instance() const { return instance_; } 101 WebSocketEndpointLockManager* instance() const { return instance_; }
102 102
103 IPEndPoint DummyEndpoint() { 103 IPEndPoint DummyEndpoint() {
104 IPAddressNumber ip_address_number; 104 IPAddressNumber ip_address_number;
105 CHECK(ParseIPLiteralToNumber("127.0.0.1", &ip_address_number)); 105 CHECK(ParseIPLiteralToNumber("127.0.0.1", &ip_address_number));
106 return IPEndPoint(ip_address_number, 80); 106 return IPEndPoint(ip_address_number, 80);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 instance()->UnlockEndpoint(DummyEndpoint()); 215 instance()->UnlockEndpoint(DummyEndpoint());
216 EXPECT_TRUE(waiters[1].called()); 216 EXPECT_TRUE(waiters[1].called());
217 instance()->RememberSocket(&dummy_sockets[1], DummyEndpoint()); 217 instance()->RememberSocket(&dummy_sockets[1], DummyEndpoint());
218 218
219 UnlockDummyEndpoint(1); 219 UnlockDummyEndpoint(1);
220 } 220 }
221 221
222 } // namespace 222 } // namespace
223 223
224 } // namespace net 224 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/unix_domain_listen_socket_posix_unittest.cc ('k') | net/socket/websocket_transport_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698