OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 request->setSelector(local_stream, component); | 362 request->setSelector(local_stream, component); |
363 pc_handler_->getStats(request.get()); | 363 pc_handler_->getStats(request.get()); |
364 EXPECT_EQ(0, request->result()->report_count()); | 364 EXPECT_EQ(0, request->result()->report_count()); |
365 } | 365 } |
366 | 366 |
367 TEST_F(RTCPeerConnectionHandlerTest, OnStateChange) { | 367 TEST_F(RTCPeerConnectionHandlerTest, OnStateChange) { |
368 // Ready states. | 368 // Ready states. |
369 webrtc::PeerConnectionObserver::StateType state = | 369 webrtc::PeerConnectionObserver::StateType state = |
370 webrtc::PeerConnectionObserver::kReadyState; | 370 webrtc::PeerConnectionObserver::kReadyState; |
371 mock_peer_connection_->SetReadyState( | 371 mock_peer_connection_->SetReadyState( |
372 webrtc::PeerConnectionInterface::kOpening); | 372 webrtc::PeerConnectionInterface::kHaveRemoteOffer); |
373 pc_handler_->OnStateChange(state); | 373 pc_handler_->OnStateChange(state); |
374 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateOpening, | 374 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateOpening, |
375 mock_client_->ready_state()); | 375 mock_client_->ready_state()); |
376 mock_peer_connection_->SetReadyState( | 376 mock_peer_connection_->SetReadyState( |
377 webrtc::PeerConnectionInterface::kActive); | 377 webrtc::PeerConnectionInterface::kActive); |
378 pc_handler_->OnStateChange(state); | 378 pc_handler_->OnStateChange(state); |
379 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateActive, | 379 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateActive, |
380 mock_client_->ready_state()); | 380 mock_client_->ready_state()); |
381 mock_peer_connection_->SetReadyState( | 381 mock_peer_connection_->SetReadyState( |
382 webrtc::PeerConnectionInterface::kClosing); | |
383 pc_handler_->OnStateChange(state); | |
384 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosing, | |
385 mock_client_->ready_state()); | |
386 mock_peer_connection_->SetReadyState( | |
387 webrtc::PeerConnectionInterface::kClosed); | 382 webrtc::PeerConnectionInterface::kClosed); |
388 pc_handler_->OnStateChange(state); | 383 pc_handler_->OnStateChange(state); |
389 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed, | 384 EXPECT_EQ(WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed, |
390 mock_client_->ready_state()); | 385 mock_client_->ready_state()); |
391 | 386 |
392 // Ice states. | 387 // Ice states. |
393 state = webrtc::PeerConnectionObserver::kIceState; | 388 state = webrtc::PeerConnectionObserver::kIceState; |
394 mock_peer_connection_->SetIceState( | 389 mock_peer_connection_->SetIceState( |
395 webrtc::PeerConnectionInterface::kIceGathering); | 390 webrtc::PeerConnectionInterface::kIceGathering); |
396 pc_handler_->OnStateChange(state); | 391 pc_handler_->OnStateChange(state); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 switches::kEnableDataChannels); | 459 switches::kEnableDataChannels); |
465 | 460 |
466 WebKit::WebString label = "d1"; | 461 WebKit::WebString label = "d1"; |
467 scoped_ptr<WebKit::WebRTCDataChannelHandler> channel( | 462 scoped_ptr<WebKit::WebRTCDataChannelHandler> channel( |
468 pc_handler_->createDataChannel("d1", true)); | 463 pc_handler_->createDataChannel("d1", true)); |
469 EXPECT_TRUE(channel.get() != NULL); | 464 EXPECT_TRUE(channel.get() != NULL); |
470 EXPECT_EQ(label, channel->label()); | 465 EXPECT_EQ(label, channel->label()); |
471 } | 466 } |
472 | 467 |
473 } // namespace content | 468 } // namespace content |
OLD | NEW |