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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/big_endian.h" | 10 #include "base/big_endian.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 EXPECT_FALSE(expected_packet_size_.empty()); | 40 EXPECT_FALSE(expected_packet_size_.empty()); |
41 size_t expected_packet_size = expected_packet_size_.front(); | 41 size_t expected_packet_size = expected_packet_size_.front(); |
42 expected_packet_size_.pop_front(); | 42 expected_packet_size_.pop_front(); |
43 EXPECT_EQ(expected_packet_size, packet->data.size()); | 43 EXPECT_EQ(expected_packet_size, packet->data.size()); |
44 bytes_sent_ += packet->data.size(); | 44 bytes_sent_ += packet->data.size(); |
45 return true; | 45 return true; |
46 } | 46 } |
47 | 47 |
48 int64_t GetBytesSent() final { return bytes_sent_; } | 48 int64_t GetBytesSent() final { return bytes_sent_; } |
49 | 49 |
| 50 void StartReceiving( |
| 51 const PacketReceiverCallbackWithStatus& packet_receiver) final {} |
| 52 |
| 53 void StopReceiving() final {} |
| 54 |
50 void AddExpectedSize(int expected_packet_size, int repeat_count) { | 55 void AddExpectedSize(int expected_packet_size, int repeat_count) { |
51 for (int i = 0; i < repeat_count; ++i) { | 56 for (int i = 0; i < repeat_count; ++i) { |
52 expected_packet_size_.push_back(expected_packet_size); | 57 expected_packet_size_.push_back(expected_packet_size); |
53 } | 58 } |
54 } | 59 } |
55 | 60 |
56 public: | 61 public: |
57 std::list<int> expected_packet_size_; | 62 std::list<int> expected_packet_size_; |
58 int64_t bytes_sent_; | 63 int64_t bytes_sent_; |
59 | 64 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); | 462 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); |
458 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent()); | 463 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent()); |
459 | 464 |
460 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5); | 465 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5); |
461 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); | 466 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); |
462 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent()); | 467 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent()); |
463 } | 468 } |
464 | 469 |
465 } // namespace cast | 470 } // namespace cast |
466 } // namespace media | 471 } // namespace media |
OLD | NEW |