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

Unified Diff: net/socket/socket_test_util.cc

Issue 835623003: Add a delay when unlocking WebSocket endpoints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document WebSocketEndpointLockManager Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/websocket_endpoint_lock_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 308de2eaf6fe4de73868d8cec17f84748a570b89..3dfb66b23094fc9ca5ceadb45ecda67e4f44d581 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -24,6 +24,7 @@
#include "net/http/http_response_headers.h"
#include "net/socket/client_socket_pool_histograms.h"
#include "net/socket/socket.h"
+#include "net/socket/websocket_endpoint_lock_manager.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "net/ssl/ssl_info.h"
@@ -1983,6 +1984,21 @@ void MockSOCKSClientSocketPool::ReleaseSocket(const std::string& group_name,
return transport_pool_->ReleaseSocket(group_name, socket.Pass(), id);
}
+ScopedWebSocketEndpointZeroUnlockDelay::
+ ScopedWebSocketEndpointZeroUnlockDelay() {
+ old_delay_ =
+ WebSocketEndpointLockManager::GetInstance()->SetUnlockDelayForTesting(
+ base::TimeDelta());
+}
+
+ScopedWebSocketEndpointZeroUnlockDelay::
+ ~ScopedWebSocketEndpointZeroUnlockDelay() {
+ base::TimeDelta active_delay =
+ WebSocketEndpointLockManager::GetInstance()->SetUnlockDelayForTesting(
+ old_delay_);
+ EXPECT_EQ(active_delay, base::TimeDelta());
+}
+
const char kSOCKS5GreetRequest[] = { 0x05, 0x01, 0x00 };
const int kSOCKS5GreetRequestLength = arraysize(kSOCKS5GreetRequest);
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/websocket_endpoint_lock_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698