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

Unified Diff: chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc

Issue 2309823005: WIP: Add Firefox interop tests for different formats.
Patch Set: Rebase. Created 3 years, 6 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 | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc
diff --git a/chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc b/chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc
index 45bee385d84f497fc9c2ef1c0009b15f7f567ef5..34036362a8986740c8ee6b5b9c43137142bdd2d1 100644
--- a/chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc
+++ b/chrome/browser/media/webrtc/webrtc_apprtc_browsertest.cc
@@ -21,6 +21,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/feature_h264_with_openh264_ffmpeg.h"
+#include "content/public/common/features.h"
#include "content/public/test/browser_test_utils.h"
#include "media/base/media_switches.h"
#include "net/test/python_utils.h"
@@ -226,6 +228,39 @@ class WebRtcApprtcBrowserTest : public WebRtcTestBase {
return firefox_.IsValid();
}
+ void FirefoxApprtcInteropTest(const char* codec) {
+ DetectErrorsInJavaScript();
+ ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999"));
+ ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089"));
+ while (!LocalApprtcInstanceIsUp())
+ DVLOG(1) << "Waiting for AppRTC to come up...";
+
+ GURL room_url =
+ GURL(base::StringPrintf("http://localhost:9999/r/some_room"
+ "?wshpp=localhost:8089&wstls=false"
+ "&firefox_fake_device=1&vsc=%s&vrc=%s",
+ codec, codec)
+ .c_str());
+
+ chrome::AddTabAt(browser(), GURL(), -1, true);
+ content::WebContents* chrome_tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ PermissionRequestManager::FromWebContents(chrome_tab)
+ ->set_auto_response_for_test(PermissionRequestManager::ACCEPT_ALL);
+ InfoBarResponder infobar_responder(
+ InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT);
+ ui_test_utils::NavigateToURL(browser(), room_url);
+
+ ASSERT_TRUE(LaunchFirefoxWithUrl(room_url));
+
+ ASSERT_TRUE(WaitForCallToComeUp(chrome_tab));
+
+ // Ensure Firefox manages to send video our way.
+ ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab));
+
+ CheckVideoFormat(chrome_tab, codec);
+ }
+
private:
base::Process dev_appserver_;
base::Process firefox_;
@@ -274,36 +309,47 @@ IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) {
}
#if defined(OS_LINUX)
-#define MAYBE_MANUAL_FirefoxApprtcInteropTest MANUAL_FirefoxApprtcInteropTest
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestVP8 \
+ MANUAL_FirefoxApprtcInteropTestVP8
+// Firefox does not support VP9.
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestVP9 \
+ DISABLED_MANUAL_FirefoxApprtcInteropTestVP9
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestH264 \
+ MANUAL_FirefoxApprtcInteropTestH264
#else
// Not implemented yet on Windows and Mac.
-#define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInteropTest
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestVP9 \
+ DISABLED_MANUAL_FirefoxApprtcInteropTestVP8
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestVP8 \
+ DISABLED_MANUAL_FirefoxApprtcInteropTestVP9
+#define MAYBE_MANUAL_FirefoxApprtcInteropTestH264 \
+ DISABLED_MANUAL_FirefoxApprtcInteropTestH264
#endif
IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest,
- MAYBE_MANUAL_FirefoxApprtcInteropTest) {
- DetectErrorsInJavaScript();
- ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999"));
- ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089"));
- while (!LocalApprtcInstanceIsUp())
- DVLOG(1) << "Waiting for AppRTC to come up...";
-
- GURL room_url = GURL("http://localhost:9999/r/some_room"
- "?wshpp=localhost:8089&wstls=false"
- "&firefox_fake_device=1");
- chrome::AddTabAt(browser(), GURL(), -1, true);
- content::WebContents* chrome_tab =
- browser()->tab_strip_model()->GetActiveWebContents();
- PermissionRequestManager::FromWebContents(chrome_tab)
- ->set_auto_response_for_test(PermissionRequestManager::ACCEPT_ALL);
- InfoBarResponder infobar_responder(
- InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT);
- ui_test_utils::NavigateToURL(browser(), room_url);
+ MAYBE_MANUAL_FirefoxApprtcInteropTestVP8) {
+ FirefoxApprtcInteropTest("VP8");
+}
- ASSERT_TRUE(LaunchFirefoxWithUrl(room_url));
+IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest,
+ MAYBE_MANUAL_FirefoxApprtcInteropTestVP9) {
+ FirefoxApprtcInteropTest("VP9");
+}
- ASSERT_TRUE(WaitForCallToComeUp(chrome_tab));
+#if BUILDFLAG(RTC_USE_H264)
- // Ensure Firefox manages to send video our way.
- ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab));
+IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest,
+ MAYBE_MANUAL_FirefoxApprtcInteropTestH264) {
+ // Only run test if run-time feature corresponding to |rtc_use_h264| is on.
+ if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) {
+ LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
+ "Skipping "
+ "WebRtcApprtcBrowserTest.MANUAL_"
+ "FirefoxApprtcInteropTestH264 "
+ "(test \"OK\")";
+ return;
+ }
+ FirefoxApprtcInteropTest("H264");
}
+
+#endif // #if BUILDFLAG(RTC_USE_H264)
« no previous file with comments | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698