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

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket_unittest.cc

Issue 503873002: Remove implicit conversions from scoped_refptr to T* in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/browser/api/cast_channel/cast_socket.h" 5 #include "extensions/browser/api/cast_channel/cast_socket.h"
6 6
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Create a test auth reply. 379 // Create a test auth reply.
380 MessageInfo reply; 380 MessageInfo reply;
381 CreateBinaryMessage( 381 CreateBinaryMessage(
382 auth_namespace, "sender-0", "receiver-0", "abcd", &reply); 382 auth_namespace, "sender-0", "receiver-0", "abcd", &reply);
383 CastMessage reply_msg; 383 CastMessage reply_msg;
384 ASSERT_TRUE(MessageInfoToCastMessage(reply, &reply_msg)); 384 ASSERT_TRUE(MessageInfoToCastMessage(reply, &reply_msg));
385 ASSERT_TRUE(CastSocket::Serialize(reply_msg, &auth_reply_)); 385 ASSERT_TRUE(CastSocket::Serialize(reply_msg, &auth_reply_));
386 } 386 }
387 387
388 void CreateCastSocket() { 388 void CreateCastSocket() {
389 socket_ = TestCastSocket::Create(&mock_delegate_, logger_); 389 socket_ = TestCastSocket::Create(&mock_delegate_, logger_.get());
390 } 390 }
391 391
392 void CreateCastSocketSecure() { 392 void CreateCastSocketSecure() {
393 socket_ = TestCastSocket::CreateSecure(&mock_delegate_, logger_); 393 socket_ = TestCastSocket::CreateSecure(&mock_delegate_, logger_.get());
394 } 394 }
395 395
396 // Sets up CastSocket::Connect to succeed. 396 // Sets up CastSocket::Connect to succeed.
397 // Connecting the socket also starts the read loop; so we add a mock 397 // Connecting the socket also starts the read loop; so we add a mock
398 // read result that returns IO_PENDING and callback is never fired. 398 // read result that returns IO_PENDING and callback is never fired.
399 void ConnectHelper() { 399 void ConnectHelper() {
400 socket_->SetupTcp1Connect(net::SYNCHRONOUS, net::OK); 400 socket_->SetupTcp1Connect(net::SYNCHRONOUS, net::OK);
401 socket_->SetupSsl1Connect(net::SYNCHRONOUS, net::OK); 401 socket_->SetupSsl1Connect(net::SYNCHRONOUS, net::OK);
402 socket_->AddReadResult(net::ASYNC, net::ERR_IO_PENDING); 402 socket_->AddReadResult(net::ASYNC, net::ERR_IO_PENDING);
403 403
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 ConnectHelper(); 1197 ConnectHelper();
1198 1198
1199 EXPECT_EQ(cast_channel::READY_STATE_CLOSED, socket_->ready_state()); 1199 EXPECT_EQ(cast_channel::READY_STATE_CLOSED, socket_->ready_state());
1200 EXPECT_EQ(cast_channel::CHANNEL_ERROR_INVALID_MESSAGE, 1200 EXPECT_EQ(cast_channel::CHANNEL_ERROR_INVALID_MESSAGE,
1201 socket_->error_state()); 1201 socket_->error_state());
1202 } 1202 }
1203 1203
1204 } // namespace cast_channel 1204 } // namespace cast_channel
1205 } // namespace core_api 1205 } // namespace core_api
1206 } // namespace extensions 1206 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698