Index: extensions/browser/api/cast_channel/cast_channel_apitest.cc |
diff --git a/extensions/browser/api/cast_channel/cast_channel_apitest.cc b/extensions/browser/api/cast_channel/cast_channel_apitest.cc |
index 6c7812cda4515688e21eff822917ccdaf361062d..5f3dd014bccdd4ce7d6c4364688c7952d805352c 100644 |
--- a/extensions/browser/api/cast_channel/cast_channel_apitest.cc |
+++ b/extensions/browser/api/cast_channel/cast_channel_apitest.cc |
@@ -98,21 +98,14 @@ class CastChannelAPITest : public ExtensionApiTest { |
mock_cast_socket_ = new MockCastSocket; |
// Transfers ownership of the socket. |
api->SetSocketForTest(base::WrapUnique<CastSocket>(mock_cast_socket_)); |
- ON_CALL(*mock_cast_socket_, set_id(_)) |
- .WillByDefault(SaveArg<0>(&channel_id_)); |
- ON_CALL(*mock_cast_socket_, id()) |
- .WillByDefault(ReturnPointee(&channel_id_)); |
- ON_CALL(*mock_cast_socket_, ip_endpoint()) |
- .WillByDefault(ReturnRef(ip_endpoint_)); |
- ON_CALL(*mock_cast_socket_, channel_auth()) |
- .WillByDefault(Return(ChannelAuthType::SSL_VERIFIED)); |
- ON_CALL(*mock_cast_socket_, keep_alive()).WillByDefault(Return(false)); |
+ mock_cast_socket_->SetIPEndpoint(ip_endpoint_); |
+ mock_cast_socket_->SetChannelAuth(ChannelAuthType::SSL_VERIFIED); |
+ mock_cast_socket_->SetKeepAlive(false); |
} |
void SetUpOpenSendClose() { |
SetUpMockCastSocket(); |
- EXPECT_CALL(*mock_cast_socket_, error_state()) |
- .WillRepeatedly(Return(ChannelError::NONE)); |
+ mock_cast_socket_->SetErrorState(ChannelError::NONE); |
{ |
InSequence sequence; |
EXPECT_CALL(*mock_cast_socket_, ConnectRawPtr(_, _)) |
@@ -133,9 +126,8 @@ class CastChannelAPITest : public ExtensionApiTest { |
void SetUpOpenPingTimeout() { |
SetUpMockCastSocket(); |
- EXPECT_CALL(*mock_cast_socket_, error_state()) |
- .WillRepeatedly(Return(ChannelError::NONE)); |
- EXPECT_CALL(*mock_cast_socket_, keep_alive()).WillRepeatedly(Return(true)); |
+ mock_cast_socket_->SetErrorState(ChannelError::NONE); |
+ mock_cast_socket_->SetKeepAlive(true); |
{ |
InSequence sequence; |
EXPECT_CALL(*mock_cast_socket_, ConnectRawPtr(_, _)) |
@@ -297,8 +289,7 @@ IN_PROC_BROWSER_TEST_F(CastChannelAPITest, MAYBE_TestPingTimeoutSslVerified) { |
// writing, reading, and closing. |
IN_PROC_BROWSER_TEST_F(CastChannelAPITest, MAYBE_TestOpenReceiveClose) { |
SetUpMockCastSocket(); |
- EXPECT_CALL(*mock_cast_socket_, error_state()) |
- .WillRepeatedly(Return(ChannelError::NONE)); |
+ mock_cast_socket_->SetErrorState(ChannelError::NONE); |
{ |
InSequence sequence; |
@@ -338,8 +329,7 @@ IN_PROC_BROWSER_TEST_F(CastChannelAPITest, MAYBE_TestOpenError) { |
.WillOnce(DoAll( |
SaveArg<0>(&message_delegate_), InvokeDelegateOnError(this, GetApi()), |
InvokeCompletionCallback<1>(ChannelError::CONNECT_ERROR))); |
- EXPECT_CALL(*mock_cast_socket_, error_state()) |
- .WillRepeatedly(Return(ChannelError::CONNECT_ERROR)); |
+ mock_cast_socket_->SetErrorState(ChannelError::CONNECT_ERROR); |
EXPECT_CALL(*mock_cast_socket_, ready_state()) |
.WillRepeatedly(Return(ReadyState::CLOSED)); |
EXPECT_CALL(*mock_cast_socket_, Close(_)) |