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

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

Issue 2688463003: [chrome.cast.channel] Remove event logging. (Closed)
Patch Set: Remove errors object when socket is closed Created 3 years, 10 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
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_transport.h" 5 #include "extensions/browser/api/cast_channel/cast_transport.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "base/test/simple_test_clock.h" 16 #include "base/test/simple_test_clock.h"
17 #include "extensions/browser/api/cast_channel/cast_framer.h" 17 #include "extensions/browser/api/cast_channel/cast_framer.h"
18 #include "extensions/browser/api/cast_channel/cast_socket.h" 18 #include "extensions/browser/api/cast_channel/cast_socket.h"
19 #include "extensions/browser/api/cast_channel/cast_test_util.h" 19 #include "extensions/browser/api/cast_channel/cast_test_util.h"
20 #include "extensions/browser/api/cast_channel/logger.h" 20 #include "extensions/browser/api/cast_channel/logger.h"
21 #include "extensions/browser/api/cast_channel/logger_util.h"
22 #include "extensions/common/api/cast_channel/cast_channel.pb.h" 21 #include "extensions/common/api/cast_channel/cast_channel.pb.h"
23 #include "net/base/completion_callback.h" 22 #include "net/base/completion_callback.h"
24 #include "net/base/net_errors.h" 23 #include "net/base/net_errors.h"
25 #include "net/log/test_net_log.h" 24 #include "net/log/test_net_log.h"
26 #include "net/socket/socket.h" 25 #include "net/socket/socket.h"
27 #include "testing/gmock/include/gmock/gmock.h" 26 #include "testing/gmock/include/gmock/gmock.h"
28 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
29 28
30 using testing::_; 29 using testing::_;
31 using testing::DoAll; 30 using testing::DoAll;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 139 }
141 140
142 virtual int SetSendBufferSize(int32_t size) { 141 virtual int SetSendBufferSize(int32_t size) {
143 NOTREACHED(); 142 NOTREACHED();
144 return 0; 143 return 0;
145 } 144 }
146 }; 145 };
147 146
148 class CastTransportTest : public testing::Test { 147 class CastTransportTest : public testing::Test {
149 public: 148 public:
150 CastTransportTest() 149 CastTransportTest() : logger_(new Logger()) {
151 : logger_(
152 new Logger(base::WrapUnique<base::Clock>(new base::SimpleTestClock),
153 base::Time())) {
154 delegate_ = new MockCastTransportDelegate; 150 delegate_ = new MockCastTransportDelegate;
155 transport_.reset(new CastTransportImpl(&mock_socket_, kChannelId, 151 transport_.reset(new CastTransportImpl(&mock_socket_, kChannelId,
156 CreateIPEndPointForTest(), 152 CreateIPEndPointForTest(),
157 auth_type_, logger_)); 153 auth_type_, logger_));
158 transport_->SetReadDelegate(base::WrapUnique(delegate_)); 154 transport_->SetReadDelegate(base::WrapUnique(delegate_));
159 } 155 }
160 ~CastTransportTest() override {} 156 ~CastTransportTest() override {}
161 157
162 protected: 158 protected:
163 // Runs all pending tasks in the message loop. 159 // Runs all pending tasks in the message loop.
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 MessageFramer::MessageHeader::header_size() - 1)), 675 MessageFramer::MessageHeader::header_size() - 1)),
680 Return(serialized_message.size() - 676 Return(serialized_message.size() -
681 MessageFramer::MessageHeader::header_size()))) 677 MessageFramer::MessageHeader::header_size())))
682 .RetiresOnSaturation(); 678 .RetiresOnSaturation();
683 EXPECT_CALL(*delegate_, OnError(CHANNEL_ERROR_INVALID_MESSAGE)); 679 EXPECT_CALL(*delegate_, OnError(CHANNEL_ERROR_INVALID_MESSAGE));
684 transport_->Start(); 680 transport_->Start();
685 } 681 }
686 } // namespace cast_channel 682 } // namespace cast_channel
687 } // namespace api 683 } // namespace api
688 } // namespace extensions 684 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698