summaryrefslogtreecommitdiffstats
path: root/chrome/browser/media/webrtc_browsertest_base.cc
diff options
context:
space:
mode:
authormcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-16 18:18:04 +0000
committermcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-16 18:18:04 +0000
commit043e8104dd90610a4dc8af1980b3cc938d237a0f (patch)
tree7c156c9856a177a28761b7e942fd032b6f5cfb85 /chrome/browser/media/webrtc_browsertest_base.cc
parentc162b848dc8e814550d22326988d843fd13a8168 (diff)
downloadchromium_src-043e8104dd90610a4dc8af1980b3cc938d237a0f.zip
chromium_src-043e8104dd90610a4dc8af1980b3cc938d237a0f.tar.gz
chromium_src-043e8104dd90610a4dc8af1980b3cc938d237a0f.tar.bz2
Migrate WebRtcVideoQualityBrowserTest to using FileVideoCaptureDevice.
The WebRtcVideoQualityBrowserTest has only one test case currently, that test encode-decoding of a stream, then dumps a series of png files from which it recovers a yuv sequence that is then compared to the original. This CL changes the infrastructure of the test, from an external fake webcam, to using the FileVideoCaptureDevice. This device uses an .y4m file, that is expected to be in the same location as the .yuv reference file, and both should be the same sequence. This location is hanging at the same place and level than Chromium src checkout, and with a name "webrtc_videos" This folder is not the same used by the test as scratch. Using WebRtcVideoQualityBrowserTest::GetSourceDir()/../bla was not possible because the base::File used inside FileVCD does not tolerate relative paths. So a peculiar method GetReferencesVideosDir() is introduced, were the trailing .../src is removed manually from the path. BUG=343504, 340609 Review URL: https://codereview.chromium.org/192293005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/media/webrtc_browsertest_base.cc')
-rw-r--r--chrome/browser/media/webrtc_browsertest_base.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/media/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc_browsertest_base.cc
index 5ec4623..21c18b5 100644
--- a/chrome/browser/media/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc_browsertest_base.cc
@@ -21,6 +21,9 @@
const char WebRtcTestBase::kAudioVideoCallConstraints[] =
"'{audio: true, video: true}'";
+const char WebRtcTestBase::kAudioVideoCallConstraints360p[] =
+ "'{audio: true, video: {mandatory: {minWidth: 640, maxWidth: 640, "
+ " minHeight: 360, maxHeight: 360}}}'";
const char WebRtcTestBase::kAudioOnlyCallConstraints[] = "'{audio: true}'";
const char WebRtcTestBase::kVideoOnlyCallConstraints[] = "'{video: true}'";
const char WebRtcTestBase::kFailedWithPermissionDeniedError[] =
@@ -149,7 +152,15 @@ InfoBar* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
}
content::WebContents* WebRtcTestBase::OpenPageAndGetUserMediaInNewTab(
- const GURL& url) const {
+ const GURL& url) const {
+ return OpenPageAndGetUserMediaInNewTabWithConstraints(
+ url, kAudioVideoCallConstraints);
+}
+
+content::WebContents*
+WebRtcTestBase::OpenPageAndGetUserMediaInNewTabWithConstraints(
+ const GURL& url,
+ const std::string& constraints) const {
chrome::AddTabAt(browser(), GURL(), -1, true);
ui_test_utils::NavigateToURL(browser(), url);
#if defined (OS_LINUX)
@@ -158,7 +169,7 @@ content::WebContents* WebRtcTestBase::OpenPageAndGetUserMediaInNewTab(
#endif
content::WebContents* new_tab =
browser()->tab_strip_model()->GetActiveWebContents();
- GetUserMediaAndAccept(new_tab);
+ GetUserMediaWithSpecificConstraintsAndAccept(new_tab, constraints);
return new_tab;
}