diff options
author | grunell@chromium.org <grunell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-21 19:55:30 +0000 |
---|---|---|
committer | grunell@chromium.org <grunell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-21 19:55:30 +0000 |
commit | 1256978bca1fe7a5c002f6c994201bc784244916 (patch) | |
tree | 8b4d6ce7ac1cda49f6bcbf3eec338be4424e25e3 /chrome/browser/media/webrtc_browsertest_base.cc | |
parent | 13f616440618376f01ac0272cc089a40ccc8210e (diff) | |
download | chromium_src-1256978bca1fe7a5c002f6c994201bc784244916.zip chromium_src-1256978bca1fe7a5c002f6c994201bc784244916.tar.gz chromium_src-1256978bca1fe7a5c002f6c994201bc784244916.tar.bz2 |
Add disable WebRTC encryption tests.
- Broke out copying of the disable encryption command line flag to its own function. Added unit test for it.
- Added browser test.
BUG=342294
Review URL: https://codereview.chromium.org/170623003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/media/webrtc_browsertest_base.cc')
-rw-r--r-- | chrome/browser/media/webrtc_browsertest_base.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/browser/media/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc_browsertest_base.cc index 994eaa0..0cb277b 100644 --- a/chrome/browser/media/webrtc_browsertest_base.cc +++ b/chrome/browser/media/webrtc_browsertest_base.cc @@ -17,6 +17,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_service.h" #include "content/public/test/browser_test_utils.h" +#include "net/test/embedded_test_server/embedded_test_server.h" const char WebRtcTestBase::kAudioVideoCallConstraints[] = "'{audio: true, video: true}'"; @@ -158,6 +159,12 @@ content::WebContents* WebRtcTestBase::OpenPageAndGetUserMediaInNewTab( return new_tab; } +content::WebContents* WebRtcTestBase::OpenTestPageAndGetUserMediaInNewTab( + const std::string& test_page) const { + return OpenPageAndGetUserMediaInNewTab( + embedded_test_server()->GetURL(test_page)); +} + content::WebContents* WebRtcTestBase::OpenPageAndAcceptUserMedia( const GURL& url) const { content::WindowedNotificationObserver infobar_added( @@ -215,6 +222,33 @@ void WebRtcTestBase::ConnectToPeerConnectionServer( EXPECT_EQ("ok-connected", ExecuteJavascript(javascript, tab_contents)); } +void WebRtcTestBase::EstablishCall(content::WebContents* from_tab, + content::WebContents* to_tab) const { + ConnectToPeerConnectionServer("peer 1", from_tab); + ConnectToPeerConnectionServer("peer 2", to_tab); + + EXPECT_EQ("ok-peerconnection-created", + ExecuteJavascript("preparePeerConnection()", from_tab)); + EXPECT_EQ("ok-added", ExecuteJavascript("addLocalStream()", from_tab)); + EXPECT_EQ("ok-negotiating", ExecuteJavascript("negotiateCall()", from_tab)); + + // Ensure the call gets up on both sides. + EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()", + "active", from_tab)); + EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()", + "active", to_tab)); +} + +void WebRtcTestBase::HangUp(content::WebContents* from_tab) const { + EXPECT_EQ("ok-call-hung-up", ExecuteJavascript("hangUp()", from_tab)); +} + +void WebRtcTestBase::WaitUntilHangupVerified( + content::WebContents* tab_contents) const { + EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()", + "no-peer-connection", tab_contents)); +} + void WebRtcTestBase::DetectErrorsInJavaScript() { detect_errors_in_javascript_ = true; } |