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 ExecuteJavascript("getWhitelistedStatsTypes()", tab)); | 552 ExecuteJavascript("getWhitelistedStatsTypes()", tab)); |
553 } | 553 } |
554 | 554 |
555 void WebRtcTestBase::SetDefaultAudioCodec( | 555 void WebRtcTestBase::SetDefaultAudioCodec( |
556 content::WebContents* tab, | 556 content::WebContents* tab, |
557 const std::string& audio_codec) const { | 557 const std::string& audio_codec) const { |
558 EXPECT_EQ("ok", ExecuteJavascript( | 558 EXPECT_EQ("ok", ExecuteJavascript( |
559 "setDefaultAudioCodec('" + audio_codec + "')", tab)); | 559 "setDefaultAudioCodec('" + audio_codec + "')", tab)); |
560 } | 560 } |
561 | 561 |
562 void WebRtcTestBase::SetDefaultVideoCodec( | 562 void WebRtcTestBase::SetDefaultVideoCodec(content::WebContents* tab, |
563 content::WebContents* tab, | 563 const std::string& video_codec, |
564 const std::string& video_codec) const { | 564 bool prefer_hw_codec) const { |
565 EXPECT_EQ("ok", ExecuteJavascript( | 565 EXPECT_EQ("ok", |
566 "setDefaultVideoCodec('" + video_codec + "')", tab)); | 566 ExecuteJavascript("setDefaultVideoCodec('" + video_codec + "'," + |
| 567 (prefer_hw_codec ? "true" : "false") + ")", |
| 568 tab)); |
567 } | 569 } |
568 | 570 |
569 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 571 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
570 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 572 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
571 } | 573 } |
572 | 574 |
573 void WebRtcTestBase::CreateAndAddStreams(content::WebContents* tab, | 575 void WebRtcTestBase::CreateAndAddStreams(content::WebContents* tab, |
574 size_t count) const { | 576 size_t count) const { |
575 EXPECT_EQ( | 577 EXPECT_EQ( |
576 "ok-streams-created-and-added", | 578 "ok-streams-created-and-added", |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 EXPECT_TRUE(base::StartsWith(result, "ok-negotiation-count-is-", | 690 EXPECT_TRUE(base::StartsWith(result, "ok-negotiation-count-is-", |
689 base::CompareCase::SENSITIVE)); | 691 base::CompareCase::SENSITIVE)); |
690 size_t count = 0; | 692 size_t count = 0; |
691 EXPECT_TRUE(base::StringToSizeT(result.substr(24), &count)); | 693 EXPECT_TRUE(base::StringToSizeT(result.substr(24), &count)); |
692 return count; | 694 return count; |
693 } | 695 } |
694 | 696 |
695 void WebRtcTestBase::CollectGarbage(content::WebContents* tab) const { | 697 void WebRtcTestBase::CollectGarbage(content::WebContents* tab) const { |
696 EXPECT_EQ("ok-gc", ExecuteJavascript("collectGarbage()", tab)); | 698 EXPECT_EQ("ok-gc", ExecuteJavascript("collectGarbage()", tab)); |
697 } | 699 } |
OLD | NEW |