Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc

Issue 271653002: Rewrote WebRTC browser tests to not use peerconnection_server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/all.gyp ('k') | chrome/browser/media/chrome_webrtc_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
diff --git a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
index a1e492e8b5aafce5f365bb22b02ad69cc169c510..5e59a10acbd63de3fc3cc5d1743d981af9cd517c 100644
--- a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
+++ b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
@@ -87,7 +87,6 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
public:
WebRtcAudioQualityBrowserTest() {}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
- test::PeerConnectionServerRunner::KillAllPeerConnectionServers();
DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
}
@@ -114,18 +113,6 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
EXPECT_EQ("ok-playing", ExecuteJavascript("playAudioFile()", tab_contents));
}
- void EstablishCall(content::WebContents* from_tab,
- content::WebContents* to_tab) {
- EXPECT_EQ("ok-negotiating",
- ExecuteJavascript("negotiateCall()", from_tab));
-
- // Ensure the call gets up on both sides.
- EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
- "active", from_tab));
- EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
- "active", to_tab));
- }
-
base::FilePath CreateTemporaryWaveFile() {
base::FilePath filename;
EXPECT_TRUE(base::CreateTemporaryFile(&filename));
@@ -134,8 +121,6 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
EXPECT_TRUE(base::Move(filename, wav_filename));
return wav_filename;
}
-
- test::PeerConnectionServerRunner peerconnection_server_;
};
class AudioRecorder {
@@ -373,7 +358,6 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest,
#endif
ASSERT_TRUE(test::HasReferenceFilesInCheckout());
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
- ASSERT_TRUE(peerconnection_server_.Start());
ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent());
@@ -388,15 +372,16 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest,
ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage));
- ConnectToPeerConnectionServer("peer 1", left_tab);
- ConnectToPeerConnectionServer("peer 2", right_tab);
-
+ // Prepare the peer connections manually in this test since we don't add
+ // getUserMedia-derived media streams in this test like the other tests.
EXPECT_EQ("ok-peerconnection-created",
ExecuteJavascript("preparePeerConnection()", left_tab));
+ EXPECT_EQ("ok-peerconnection-created",
+ ExecuteJavascript("preparePeerConnection()", right_tab));
AddAudioFile(kReferenceFileRelativeUrl, left_tab);
- EstablishCall(left_tab, right_tab);
+ NegotiateCall(left_tab, right_tab);
// Note: the media flow isn't necessarily established on the connection just
// because the ready state is ok on both sides. We sleep a bit between call
@@ -418,8 +403,6 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest,
VLOG(0) << "Done recording to " << recording.value() << std::endl;
HangUp(left_tab);
- WaitUntilHangupVerified(left_tab);
- WaitUntilHangupVerified(right_tab);
base::FilePath trimmed_recording = CreateTemporaryWaveFile();
@@ -438,6 +421,4 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest,
EXPECT_TRUE(base::DeleteFile(recording, false));
EXPECT_TRUE(base::DeleteFile(trimmed_recording, false));
-
- ASSERT_TRUE(peerconnection_server_.Stop());
}
« no previous file with comments | « build/all.gyp ('k') | chrome/browser/media/chrome_webrtc_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698