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

Unified Diff: net/websockets/websocket_job_spdy3_unittest.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/websockets/websocket_job_spdy2_unittest.cc ('k') | net/websockets/websocket_throttle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_job_spdy3_unittest.cc
diff --git a/net/websockets/websocket_job_spdy3_unittest.cc b/net/websockets/websocket_job_spdy3_unittest.cc
index 2b2228189cb0f59d3953688941cd123faf40cb80..7ba2ee61cfd1dae4961399ec8bbbbb280bc65136 100644
--- a/net/websockets/websocket_job_spdy3_unittest.cc
+++ b/net/websockets/websocket_job_spdy3_unittest.cc
@@ -388,7 +388,7 @@ class WebSocketJobSpdy3Test : public PlatformTest {
}
ssl_config_service_ = new MockSSLConfigService();
- context_->set_ssl_config_service(ssl_config_service_);
+ context_->set_ssl_config_service(ssl_config_service_.get());
proxy_service_.reset(ProxyService::CreateDirect());
context_->set_proxy_service(proxy_service_.get());
host_resolver_.reset(new MockHostResolver);
@@ -413,15 +413,15 @@ class WebSocketJobSpdy3Test : public PlatformTest {
}
void SkipToConnecting() {
websocket_->state_ = WebSocketJob::CONNECTING;
- WebSocketThrottle::GetInstance()->PutInQueue(websocket_);
+ WebSocketThrottle::GetInstance()->PutInQueue(websocket_.get());
}
WebSocketJob::State GetWebSocketJobState() {
return websocket_->state_;
}
void CloseWebSocketJob() {
- if (websocket_->socket_) {
+ if (websocket_->socket_.get()) {
websocket_->socket_->DetachDelegate();
- WebSocketThrottle::GetInstance()->RemoveFromQueue(websocket_);
+ WebSocketThrottle::GetInstance()->RemoveFromQueue(websocket_.get());
}
websocket_->state_ = WebSocketJob::CLOSED;
websocket_->delegate_ = NULL;
@@ -614,9 +614,7 @@ void WebSocketJobSpdy3Test::TestSlowHandshake() {
for (size_t i = 0; i < lines.size() - 2; i++) {
std::string line = lines[i] + "\r\n";
SCOPED_TRACE("Line: " + line);
- websocket_->OnReceivedData(socket_,
- line.c_str(),
- line.size());
+ websocket_->OnReceivedData(socket_.get(), line.c_str(), line.size());
base::MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(delegate.received_data().empty());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
@@ -635,10 +633,11 @@ TEST_F(WebSocketJobSpdy3Test, DelayedCookies) {
GURL cookieUrl("http://example.com/demo");
CookieOptions cookie_options;
scoped_refptr<DelayedCookieMonster> cookie_store = new DelayedCookieMonster();
- context_->set_cookie_store(cookie_store);
- cookie_store->SetCookieWithOptionsAsync(
- cookieUrl, "CR-test=1", cookie_options,
- CookieMonster::SetCookiesCallback());
+ context_->set_cookie_store(cookie_store.get());
+ cookie_store->SetCookieWithOptionsAsync(cookieUrl,
+ "CR-test=1",
+ cookie_options,
+ CookieMonster::SetCookiesCallback());
cookie_options.set_include_httponly();
cookie_store->SetCookieWithOptionsAsync(
cookieUrl, "CR-test-httponly=1", cookie_options,
@@ -654,7 +653,7 @@ TEST_F(WebSocketJobSpdy3Test, DelayedCookies) {
base::MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
- websocket_->OnSentData(socket_,
+ websocket_->OnSentData(socket_.get(),
kHandshakeRequestWithFilteredCookieLength);
EXPECT_EQ(kHandshakeRequestWithCookieLength,
delegate.amount_sent());
@@ -689,7 +688,7 @@ void WebSocketJobSpdy3Test::TestHandshakeWithCookie() {
base::MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
- websocket_->OnSentData(socket_,
+ websocket_->OnSentData(socket_.get(),
kHandshakeRequestWithFilteredCookieLength);
EXPECT_EQ(kHandshakeRequestWithCookieLength,
delegate.amount_sent());
@@ -733,9 +732,8 @@ void WebSocketJobSpdy3Test::TestHandshakeWithCookieButNotAllowed() {
base::MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
- websocket_->OnSentData(socket_, kHandshakeRequestWithoutCookieLength);
- EXPECT_EQ(kHandshakeRequestWithCookieLength,
- delegate.amount_sent());
+ websocket_->OnSentData(socket_.get(), kHandshakeRequestWithoutCookieLength);
+ EXPECT_EQ(kHandshakeRequestWithCookieLength, delegate.amount_sent());
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
@@ -863,7 +861,7 @@ void WebSocketJobSpdy3Test::TestConnectByWebSocket(
// Remove the former WebSocket object from throttling queue to unblock the
// latter.
- WebSocketThrottle::GetInstance()->RemoveFromQueue(block_websocket);
+ WebSocketThrottle::GetInstance()->RemoveFromQueue(block_websocket.get());
block_websocket->state_ = WebSocketJob::CLOSED;
block_websocket = NULL;
WebSocketThrottle::GetInstance()->WakeupSocketIfNecessary();
@@ -979,7 +977,7 @@ void WebSocketJobSpdy3Test::TestConnectBySpdy(
// Remove the former WebSocket object from throttling queue to unblock the
// latter.
- WebSocketThrottle::GetInstance()->RemoveFromQueue(block_websocket);
+ WebSocketThrottle::GetInstance()->RemoveFromQueue(block_websocket.get());
block_websocket->state_ = WebSocketJob::CLOSED;
block_websocket = NULL;
WebSocketThrottle::GetInstance()->WakeupSocketIfNecessary();
« no previous file with comments | « net/websockets/websocket_job_spdy2_unittest.cc ('k') | net/websockets/websocket_throttle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698