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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 void WebRtcTestBase::SetDefaultVideoCodec( | 552 void WebRtcTestBase::SetDefaultVideoCodec( |
553 content::WebContents* tab, | 553 content::WebContents* tab, |
554 const std::string& video_codec) const { | 554 const std::string& video_codec) const { |
555 EXPECT_EQ("ok", ExecuteJavascript( | 555 EXPECT_EQ("ok", ExecuteJavascript( |
556 "setDefaultVideoCodec('" + video_codec + "')", tab)); | 556 "setDefaultVideoCodec('" + video_codec + "')", tab)); |
557 } | 557 } |
558 | 558 |
559 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 559 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
560 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 560 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
561 } | 561 } |
| 562 |
| 563 void WebRtcTestBase::CreateAndAddStreams(content::WebContents* tab, |
| 564 size_t count) const { |
| 565 EXPECT_EQ( |
| 566 "ok-streams-created-and-added", |
| 567 ExecuteJavascript( |
| 568 "createAndAddStreams(" + base::SizeTToString(count) + ")", tab)); |
| 569 } |
| 570 |
| 571 void WebRtcTestBase::VerifyRtpReceivers( |
| 572 content::WebContents* tab, |
| 573 base::Optional<size_t> expected_num_tracks) const { |
| 574 std::string javascript = |
| 575 expected_num_tracks ? "verifyRtpReceivers(" + |
| 576 base::SizeTToString(*expected_num_tracks) + ")" |
| 577 : "verifyRtpReceivers()"; |
| 578 EXPECT_EQ("ok-receivers-verified", ExecuteJavascript(javascript, tab)); |
| 579 } |
OLD | NEW |