OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
| 7 #include "content/public/common/content_switches.h" |
| 8 #include "media/base/media_switches.h" |
| 9 |
| 10 static const char kMainWebrtcTestHtmlPage[] = "/webrtc/webrtc_jsep01_test.html"; |
| 11 |
| 12 class WebRtcRtpBrowserTest : public WebRtcTestBase { |
| 13 public: |
| 14 WebRtcRtpBrowserTest() : left_tab_(nullptr), right_tab_(nullptr) {} |
| 15 |
| 16 void SetUpInProcessBrowserTestFixture() override { |
| 17 DetectErrorsInJavaScript(); |
| 18 } |
| 19 |
| 20 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 21 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
| 22 |
| 23 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, |
| 24 "RTCRtpReceiver"); |
| 25 } |
| 26 |
| 27 protected: |
| 28 void StartServerAndOpenTabs() { |
| 29 ASSERT_TRUE(embedded_test_server()->Start()); |
| 30 left_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 31 right_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 32 } |
| 33 |
| 34 content::WebContents* left_tab_; |
| 35 content::WebContents* right_tab_; |
| 36 }; |
| 37 |
| 38 IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest, GetReceivers) { |
| 39 StartServerAndOpenTabs(); |
| 40 |
| 41 SetupPeerconnectionWithoutLocalStream(left_tab_); |
| 42 CreateAndAddStreams(left_tab_, 3); |
| 43 |
| 44 SetupPeerconnectionWithoutLocalStream(right_tab_); |
| 45 CreateAndAddStreams(right_tab_, 1); |
| 46 |
| 47 NegotiateCall(left_tab_, right_tab_); |
| 48 |
| 49 VerifyRtpReceivers(left_tab_, 2); |
| 50 VerifyRtpReceivers(right_tab_, 6); |
| 51 } |
OLD | NEW |