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

Side by Side Diff: chrome/test/chromedriver/net/sync_websocket_impl_unittest.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ASSERT_TRUE(sock.Connect(server_.web_socket_url())); 66 ASSERT_TRUE(sock.Connect(server_.web_socket_url()));
67 ASSERT_TRUE(sock.Send("hi")); 67 ASSERT_TRUE(sock.Send("hi"));
68 std::string message; 68 std::string message;
69 ASSERT_EQ( 69 ASSERT_EQ(
70 SyncWebSocket::kOk, 70 SyncWebSocket::kOk,
71 sock.ReceiveNextMessage(&message, long_timeout_)); 71 sock.ReceiveNextMessage(&message, long_timeout_));
72 ASSERT_STREQ("hi", message.c_str()); 72 ASSERT_STREQ("hi", message.c_str());
73 } 73 }
74 74
75 TEST_F(SyncWebSocketImplTest, SendReceiveTimeout) { 75 TEST_F(SyncWebSocketImplTest, SendReceiveTimeout) {
76 SyncWebSocketImpl sock(context_getter_); 76 SyncWebSocketImpl sock(context_getter_.get());
77 ASSERT_TRUE(sock.Connect(server_.web_socket_url())); 77 ASSERT_TRUE(sock.Connect(server_.web_socket_url()));
78 ASSERT_TRUE(sock.Send("hi")); 78 ASSERT_TRUE(sock.Send("hi"));
79 std::string message; 79 std::string message;
80 ASSERT_EQ( 80 ASSERT_EQ(
81 SyncWebSocket::kTimeout, 81 SyncWebSocket::kTimeout,
82 sock.ReceiveNextMessage( 82 sock.ReceiveNextMessage(
83 &message, base::TimeDelta())); 83 &message, base::TimeDelta()));
84 } 84 }
85 85
86 TEST_F(SyncWebSocketImplTest, SendReceiveLarge) { 86 TEST_F(SyncWebSocketImplTest, SendReceiveLarge) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ASSERT_TRUE(sock.Connect(server_.web_socket_url())); 156 ASSERT_TRUE(sock.Connect(server_.web_socket_url()));
157 ASSERT_FALSE(sock.HasNextMessage()); 157 ASSERT_FALSE(sock.HasNextMessage());
158 ASSERT_TRUE(sock.Send("3")); 158 ASSERT_TRUE(sock.Send("3"));
159 std::string message; 159 std::string message;
160 ASSERT_EQ( 160 ASSERT_EQ(
161 SyncWebSocket::kOk, 161 SyncWebSocket::kOk,
162 sock.ReceiveNextMessage(&message, long_timeout_)); 162 sock.ReceiveNextMessage(&message, long_timeout_));
163 ASSERT_STREQ("3", message.c_str()); 163 ASSERT_STREQ("3", message.c_str());
164 ASSERT_FALSE(sock.HasNextMessage()); 164 ASSERT_FALSE(sock.HasNextMessage());
165 } 165 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/adb_impl.cc ('k') | chrome/test/reliability/automated_ui_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698