| OLD | NEW |
| 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 <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 class CastTransportTest : public testing::Test { | 175 class CastTransportTest : public testing::Test { |
| 176 public: | 176 public: |
| 177 CastTransportTest() | 177 CastTransportTest() |
| 178 : logger_(new Logger( | 178 : logger_(new Logger( |
| 179 scoped_ptr<base::TickClock>(new base::SimpleTestTickClock), | 179 scoped_ptr<base::TickClock>(new base::SimpleTestTickClock), |
| 180 base::TimeTicks())) { | 180 base::TimeTicks())) { |
| 181 transport_.reset(new CastTransport(&mock_socket_, &delegate_, logger_)); | 181 transport_.reset(new CastTransport(&mock_socket_, &delegate_, logger_)); |
| 182 } | 182 } |
| 183 virtual ~CastTransportTest() {} | 183 ~CastTransportTest() override {} |
| 184 | 184 |
| 185 protected: | 185 protected: |
| 186 MockCastTransportDelegate delegate_; | 186 MockCastTransportDelegate delegate_; |
| 187 MockCastSocket mock_socket_; | 187 MockCastSocket mock_socket_; |
| 188 scoped_refptr<Logger> logger_; | 188 scoped_refptr<Logger> logger_; |
| 189 scoped_ptr<CastTransport> transport_; | 189 scoped_ptr<CastTransport> transport_; |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 // ---------------------------------------------------------------------------- | 192 // ---------------------------------------------------------------------------- |
| 193 // Asynchronous write tests | 193 // Asynchronous write tests |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 MessageFramer::MessageHeader::header_size()))) | 654 MessageFramer::MessageHeader::header_size()))) |
| 655 .RetiresOnSaturation(); | 655 .RetiresOnSaturation(); |
| 656 EXPECT_CALL(delegate_, | 656 EXPECT_CALL(delegate_, |
| 657 OnError(&mock_socket_, CHANNEL_ERROR_INVALID_MESSAGE, _)); | 657 OnError(&mock_socket_, CHANNEL_ERROR_INVALID_MESSAGE, _)); |
| 658 EXPECT_CALL(mock_socket_, CloseWithError(CHANNEL_ERROR_INVALID_MESSAGE)); | 658 EXPECT_CALL(mock_socket_, CloseWithError(CHANNEL_ERROR_INVALID_MESSAGE)); |
| 659 transport_->StartReadLoop(); | 659 transport_->StartReadLoop(); |
| 660 } | 660 } |
| 661 } // namespace cast_channel | 661 } // namespace cast_channel |
| 662 } // namespace core_api | 662 } // namespace core_api |
| 663 } // namespace extensions | 663 } // namespace extensions |
| OLD | NEW |