| 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/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 int Write(IOBuffer* buf, | 82 int Write(IOBuffer* buf, |
| 83 int buf_len, | 83 int buf_len, |
| 84 const CompletionCallback& callback) override { | 84 const CompletionCallback& callback) override { |
| 85 return ERR_FAILED; | 85 return ERR_FAILED; |
| 86 } | 86 } |
| 87 | 87 |
| 88 int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; } | 88 int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; } |
| 89 | 89 |
| 90 int SetSendBufferSize(int32_t size) override { return ERR_FAILED; } | 90 int SetSendBufferSize(int32_t size) override { return ERR_FAILED; } |
| 91 | 91 |
| 92 int SetDoNotFragment(bool do_not_fragment) override { return ERR_FAILED; } |
| 93 |
| 92 private: | 94 private: |
| 93 BoundNetLog bound_net_log_; | 95 BoundNetLog bound_net_log_; |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); | 97 DISALLOW_COPY_AND_ASSIGN(FakeStreamSocket); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { | 100 class FakeWaiter : public WebSocketEndpointLockManager::Waiter { |
| 99 public: | 101 public: |
| 100 FakeWaiter() : called_(false) {} | 102 FakeWaiter() : called_(false) {} |
| 101 | 103 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 blocking_waiter.WaitForLock(); | 332 blocking_waiter.WaitForLock(); |
| 331 TimeTicks after_unlock = TimeTicks::Now(); | 333 TimeTicks after_unlock = TimeTicks::Now(); |
| 332 EXPECT_GE(after_unlock - before_unlock, unlock_delay); | 334 EXPECT_GE(after_unlock - before_unlock, unlock_delay); |
| 333 instance()->SetUnlockDelayForTesting(base::TimeDelta()); | 335 instance()->SetUnlockDelayForTesting(base::TimeDelta()); |
| 334 UnlockDummyEndpoint(1); | 336 UnlockDummyEndpoint(1); |
| 335 } | 337 } |
| 336 | 338 |
| 337 } // namespace | 339 } // namespace |
| 338 | 340 |
| 339 } // namespace net | 341 } // namespace net |
| OLD | NEW |