OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 pc_ = pc; | 539 pc_ = pc; |
540 if (pc) { | 540 if (pc) { |
541 state_ = pc_->signaling_state(); | 541 state_ = pc_->signaling_state(); |
542 } | 542 } |
543 } | 543 } |
544 void OnSignalingChange( | 544 void OnSignalingChange( |
545 PeerConnectionInterface::SignalingState new_state) override { | 545 PeerConnectionInterface::SignalingState new_state) override { |
546 EXPECT_EQ(pc_->signaling_state(), new_state); | 546 EXPECT_EQ(pc_->signaling_state(), new_state); |
547 state_ = new_state; | 547 state_ = new_state; |
548 } | 548 } |
549 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. | |
550 virtual void OnStateChange(StateType state_changed) { | |
551 if (pc_.get() == NULL) | |
552 return; | |
553 switch (state_changed) { | |
554 case kSignalingState: | |
555 // OnSignalingChange and OnStateChange(kSignalingState) should always | |
556 // be called approximately simultaneously. To ease testing, we require | |
557 // that they always be called in that order. This check verifies | |
558 // that OnSignalingChange has just been called. | |
559 EXPECT_EQ(pc_->signaling_state(), state_); | |
560 break; | |
561 case kIceState: | |
562 ADD_FAILURE(); | |
563 break; | |
564 default: | |
565 ADD_FAILURE(); | |
566 break; | |
567 } | |
568 } | |
569 | 549 |
570 MediaStreamInterface* RemoteStream(const std::string& label) { | 550 MediaStreamInterface* RemoteStream(const std::string& label) { |
571 return remote_streams_->find(label); | 551 return remote_streams_->find(label); |
572 } | 552 } |
573 StreamCollectionInterface* remote_streams() const { return remote_streams_; } | 553 StreamCollectionInterface* remote_streams() const { return remote_streams_; } |
574 void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override { | 554 void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override { |
575 last_added_stream_ = stream; | 555 last_added_stream_ = stream; |
576 remote_streams_->AddStream(stream); | 556 remote_streams_->AddStream(stream); |
577 } | 557 } |
578 void OnRemoveStream( | 558 void OnRemoveStream( |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3395 EXPECT_NE(a, f); | 3375 EXPECT_NE(a, f); |
3396 | 3376 |
3397 PeerConnectionInterface::RTCConfiguration g; | 3377 PeerConnectionInterface::RTCConfiguration g; |
3398 g.disable_ipv6 = true; | 3378 g.disable_ipv6 = true; |
3399 EXPECT_NE(a, g); | 3379 EXPECT_NE(a, g); |
3400 | 3380 |
3401 PeerConnectionInterface::RTCConfiguration h( | 3381 PeerConnectionInterface::RTCConfiguration h( |
3402 PeerConnectionInterface::RTCConfigurationType::kAggressive); | 3382 PeerConnectionInterface::RTCConfigurationType::kAggressive); |
3403 EXPECT_NE(a, h); | 3383 EXPECT_NE(a, h); |
3404 } | 3384 } |
OLD | NEW |