OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 5 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 content::WebContents* to_tab) const { | 420 content::WebContents* to_tab) const { |
421 std::string local_offer = CreateLocalOffer(from_tab); | 421 std::string local_offer = CreateLocalOffer(from_tab); |
422 std::string answer = CreateAnswer(local_offer, to_tab); | 422 std::string answer = CreateAnswer(local_offer, to_tab); |
423 ReceiveAnswer(answer, from_tab); | 423 ReceiveAnswer(answer, from_tab); |
424 | 424 |
425 // Send all ICE candidates (wait for gathering to finish if necessary). | 425 // Send all ICE candidates (wait for gathering to finish if necessary). |
426 GatherAndSendIceCandidates(to_tab, from_tab); | 426 GatherAndSendIceCandidates(to_tab, from_tab); |
427 GatherAndSendIceCandidates(from_tab, to_tab); | 427 GatherAndSendIceCandidates(from_tab, to_tab); |
428 } | 428 } |
429 | 429 |
| 430 void WebRtcTestBase::VerifyLocalDescriptionContainsCertificate( |
| 431 content::WebContents* tab, |
| 432 const std::string& certificate) const { |
| 433 std::string javascript = base::StringPrintf( |
| 434 "verifyLocalDescriptionContainsCertificate(%s)", certificate.c_str()); |
| 435 EXPECT_EQ("ok-verified", ExecuteJavascript(javascript, tab)); |
| 436 } |
| 437 |
430 void WebRtcTestBase::HangUp(content::WebContents* from_tab) const { | 438 void WebRtcTestBase::HangUp(content::WebContents* from_tab) const { |
431 EXPECT_EQ("ok-call-hung-up", ExecuteJavascript("hangUp()", from_tab)); | 439 EXPECT_EQ("ok-call-hung-up", ExecuteJavascript("hangUp()", from_tab)); |
432 } | 440 } |
433 | 441 |
434 void WebRtcTestBase::DetectErrorsInJavaScript() { | 442 void WebRtcTestBase::DetectErrorsInJavaScript() { |
435 detect_errors_in_javascript_ = true; | 443 detect_errors_in_javascript_ = true; |
436 } | 444 } |
437 | 445 |
438 void WebRtcTestBase::StartDetectingVideo( | 446 void WebRtcTestBase::StartDetectingVideo( |
439 content::WebContents* tab_contents, | 447 content::WebContents* tab_contents, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 588 |
581 void WebRtcTestBase::VerifyRtpReceivers( | 589 void WebRtcTestBase::VerifyRtpReceivers( |
582 content::WebContents* tab, | 590 content::WebContents* tab, |
583 base::Optional<size_t> expected_num_tracks) const { | 591 base::Optional<size_t> expected_num_tracks) const { |
584 std::string javascript = | 592 std::string javascript = |
585 expected_num_tracks ? "verifyRtpReceivers(" + | 593 expected_num_tracks ? "verifyRtpReceivers(" + |
586 base::SizeTToString(*expected_num_tracks) + ")" | 594 base::SizeTToString(*expected_num_tracks) + ")" |
587 : "verifyRtpReceivers()"; | 595 : "verifyRtpReceivers()"; |
588 EXPECT_EQ("ok-receivers-verified", ExecuteJavascript(javascript, tab)); | 596 EXPECT_EQ("ok-receivers-verified", ExecuteJavascript(javascript, tab)); |
589 } | 597 } |
OLD | NEW |