OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return dme; | 65 return dme; |
66 } | 66 } |
67 | 67 |
68 cricket::RtpDataMediaChannel* CreateChannel() { | 68 cricket::RtpDataMediaChannel* CreateChannel() { |
69 return CreateChannel(dme_.get()); | 69 return CreateChannel(dme_.get()); |
70 } | 70 } |
71 | 71 |
72 cricket::RtpDataMediaChannel* CreateChannel(cricket::RtpDataEngine* dme) { | 72 cricket::RtpDataMediaChannel* CreateChannel(cricket::RtpDataEngine* dme) { |
73 cricket::MediaConfig config; | 73 cricket::MediaConfig config; |
74 cricket::RtpDataMediaChannel* channel = | 74 cricket::RtpDataMediaChannel* channel = |
75 static_cast<cricket::RtpDataMediaChannel*>( | 75 static_cast<cricket::RtpDataMediaChannel*>(dme->CreateChannel(config)); |
76 dme->CreateChannel(cricket::DCT_RTP, config)); | |
77 channel->SetInterface(iface_.get()); | 76 channel->SetInterface(iface_.get()); |
78 channel->SignalDataReceived.connect( | 77 channel->SignalDataReceived.connect( |
79 receiver_.get(), &FakeDataReceiver::OnDataReceived); | 78 receiver_.get(), &FakeDataReceiver::OnDataReceived); |
80 return channel; | 79 return channel; |
81 } | 80 } |
82 | 81 |
83 FakeDataReceiver* receiver() { | 82 FakeDataReceiver* receiver() { |
84 return receiver_.get(); | 83 return receiver_.get(); |
85 } | 84 } |
86 | 85 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 0x80, 0x65, 0x00, 0x02 | 368 0x80, 0x65, 0x00, 0x02 |
370 }; | 369 }; |
371 rtc::CopyOnWriteBuffer packet(data, sizeof(data)); | 370 rtc::CopyOnWriteBuffer packet(data, sizeof(data)); |
372 | 371 |
373 std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); | 372 std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); |
374 | 373 |
375 // Too short | 374 // Too short |
376 dmc->OnPacketReceived(&packet, rtc::PacketTime()); | 375 dmc->OnPacketReceived(&packet, rtc::PacketTime()); |
377 EXPECT_FALSE(HasReceivedData()); | 376 EXPECT_FALSE(HasReceivedData()); |
378 } | 377 } |
OLD | NEW |