OLD | NEW |
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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
12 #include "net/socket/next_proto.h" | 13 #include "net/socket/next_proto.h" |
13 #include "net/socket/socket_test_util.h" | 14 #include "net/socket/socket_test_util.h" |
14 #include "net/socket/stream_socket.h" | 15 #include "net/socket/stream_socket.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const CompletionCallback& callback) override { | 75 const CompletionCallback& callback) override { |
75 return ERR_FAILED; | 76 return ERR_FAILED; |
76 } | 77 } |
77 | 78 |
78 int Write(IOBuffer* buf, | 79 int Write(IOBuffer* buf, |
79 int buf_len, | 80 int buf_len, |
80 const CompletionCallback& callback) override { | 81 const CompletionCallback& callback) override { |
81 return ERR_FAILED; | 82 return ERR_FAILED; |
82 } | 83 } |
83 | 84 |
84 int SetReceiveBufferSize(int32 size) override { return ERR_FAILED; } | 85 int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; } |
85 | 86 |
86 int SetSendBufferSize(int32 size) override { return ERR_FAILED; } | 87 int SetSendBufferSize(int32_t size) override { return ERR_FAILED; } |
87 | 88 |
88 private: | 89 private: |
89 BoundNetLog bound_net_log_; | 90 BoundNetLog bound_net_log_; |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); | 92 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); |
92 }; | 93 }; |
93 | 94 |
94 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { | 95 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { |
95 public: | 96 public: |
96 FakeWaiter() : called_(false) {} | 97 FakeWaiter() : called_(false) {} |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 blocking_waiter.WaitForLock(); | 327 blocking_waiter.WaitForLock(); |
327 TimeTicks after_unlock = TimeTicks::Now(); | 328 TimeTicks after_unlock = TimeTicks::Now(); |
328 EXPECT_GE(after_unlock - before_unlock, unlock_delay); | 329 EXPECT_GE(after_unlock - before_unlock, unlock_delay); |
329 instance()->SetUnlockDelayForTesting(base::TimeDelta()); | 330 instance()->SetUnlockDelayForTesting(base::TimeDelta()); |
330 UnlockDummyEndpoint(1); | 331 UnlockDummyEndpoint(1); |
331 } | 332 } |
332 | 333 |
333 } // namespace | 334 } // namespace |
334 | 335 |
335 } // namespace net | 336 } // namespace net |
OLD | NEW |