OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class SctpFakeDataReceiver : public sigslot::has_slots<> { | 43 class SctpFakeDataReceiver : public sigslot::has_slots<> { |
44 public: | 44 public: |
45 SctpFakeDataReceiver() : received_(false) {} | 45 SctpFakeDataReceiver() : received_(false) {} |
46 | 46 |
47 void Clear() { | 47 void Clear() { |
48 received_ = false; | 48 received_ = false; |
49 last_data_ = ""; | 49 last_data_ = ""; |
50 last_params_ = ReceiveDataParams(); | 50 last_params_ = ReceiveDataParams(); |
51 } | 51 } |
52 | 52 |
53 virtual void OnDataReceived(const ReceiveDataParams& params, | 53 void OnDataReceived(const ReceiveDataParams& params, |
54 const rtc::CopyOnWriteBuffer& data) { | 54 const rtc::CopyOnWriteBuffer& data) { |
55 received_ = true; | 55 received_ = true; |
56 last_data_ = std::string(data.data<char>(), data.size()); | 56 last_data_ = std::string(data.data<char>(), data.size()); |
57 last_params_ = params; | 57 last_params_ = params; |
58 } | 58 } |
59 | 59 |
60 bool received() const { return received_; } | 60 bool received() const { return received_; } |
61 std::string last_data() const { return last_data_; } | 61 std::string last_data() const { return last_data_; } |
62 ReceiveDataParams last_params() const { return last_params_; } | 62 ReceiveDataParams last_params() const { return last_params_; } |
63 | 63 |
64 private: | 64 private: |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 AddStream(1); | 554 AddStream(1); |
555 ASSERT_TRUE(SendData(transport1(), 1, "hi?", &result)); | 555 ASSERT_TRUE(SendData(transport1(), 1, "hi?", &result)); |
556 EXPECT_EQ(SDR_SUCCESS, result); | 556 EXPECT_EQ(SDR_SUCCESS, result); |
557 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), kDefaultTimeout); | 557 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), kDefaultTimeout); |
558 transport1()->ResetStream(1); | 558 transport1()->ResetStream(1); |
559 EXPECT_TRUE_WAIT(transport2_sig_receiver.StreamCloseCount(1) == 2, | 559 EXPECT_TRUE_WAIT(transport2_sig_receiver.StreamCloseCount(1) == 2, |
560 kDefaultTimeout); | 560 kDefaultTimeout); |
561 } | 561 } |
562 | 562 |
563 } // namespace cricket | 563 } // namespace cricket |
OLD | NEW |