Commit 64acb3d4 authored by Max Morin's avatar Max Morin Committed by Commit Bot

Parametrize CastStreamingApiTestWithPixelOutput

This gives us waterfall coverage for loopback audio streams.

Bug: 843961
Change-Id: I350382ed055f894e5a44edcf7e5ec4b851835aab
Reviewed-on: https://chromium-review.googlesource.com/1065992
Commit-Queue: Yuri Wiitala <miu@chromium.org>
Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560365}
parent c589cd8c
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
#include "media/base/bind_to_current_loop.h" #include "media/base/bind_to_current_loop.h"
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
#include "net/base/rand_callback.h" #include "net/base/rand_callback.h"
#include "net/log/net_log_source.h" #include "net/log/net_log_source.h"
#include "net/socket/udp_server_socket.h" #include "net/socket/udp_server_socket.h"
#include "testing/gtest/include/gtest/gtest-param-test.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using media::cast::test::GetFreeLocalPort; using media::cast::test::GetFreeLocalPort;
...@@ -321,7 +323,23 @@ class TestPatternReceiver : public media::cast::InProcessReceiver { ...@@ -321,7 +323,23 @@ class TestPatternReceiver : public media::cast::InProcessReceiver {
} // namespace } // namespace
class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { class CastStreamingApiTestWithPixelOutput
: public CastStreamingApiTest,
public testing::WithParamInterface<bool> {
public:
CastStreamingApiTestWithPixelOutput() {
std::vector<base::Feature> audio_service_oop_features = {
features::kAudioServiceAudioStreams,
features::kAudioServiceOutOfProcess};
if (GetParam()) {
// Force audio service out of process to enabled.
audio_service_features_.InitWithFeatures(audio_service_oop_features, {});
} else {
// Force audio service out of process to disabled.
audio_service_features_.InitWithFeatures({}, audio_service_oop_features);
}
}
void SetUp() override { void SetUp() override {
EnablePixelOutput(); EnablePixelOutput();
CastStreamingApiTest::SetUp(); CastStreamingApiTest::SetUp();
...@@ -331,6 +349,9 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { ...@@ -331,6 +349,9 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest {
command_line->AppendSwitchASCII(::switches::kWindowSize, "128,128"); command_line->AppendSwitchASCII(::switches::kWindowSize, "128,128");
CastStreamingApiTest::SetUpCommandLine(command_line); CastStreamingApiTest::SetUpCommandLine(command_line);
} }
private:
base::test::ScopedFeatureList audio_service_features_;
}; };
// Tests the Cast streaming API and its basic functionality end-to-end. An // Tests the Cast streaming API and its basic functionality end-to-end. An
...@@ -344,7 +365,7 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { ...@@ -344,7 +365,7 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest {
// Flaky on Mac: https://crbug.com/841387 // Flaky on Mac: https://crbug.com/841387
#define MAYBE_EndToEnd DISABLED_EndToEnd // crbug.com/396413 #define MAYBE_EndToEnd DISABLED_EndToEnd // crbug.com/396413
#endif #endif
IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, MAYBE_EndToEnd) { IN_PROC_BROWSER_TEST_P(CastStreamingApiTestWithPixelOutput, MAYBE_EndToEnd) {
std::unique_ptr<net::UDPServerSocket> receive_socket( std::unique_ptr<net::UDPServerSocket> receive_socket(
new net::UDPServerSocket(NULL, net::NetLogSource())); new net::UDPServerSocket(NULL, net::NetLogSource()));
receive_socket->AllowAddressReuse(); receive_socket->AllowAddressReuse();
...@@ -398,9 +419,27 @@ IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, MAYBE_EndToEnd) { ...@@ -398,9 +419,27 @@ IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, MAYBE_EndToEnd) {
// Flaky on Mac https://crbug.com/841986 // Flaky on Mac https://crbug.com/841986
#define MAYBE_RtpStreamError DISABLED_RtpStreamError #define MAYBE_RtpStreamError DISABLED_RtpStreamError
#endif #endif
IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, IN_PROC_BROWSER_TEST_P(CastStreamingApiTestWithPixelOutput,
MAYBE_RtpStreamError) { MAYBE_RtpStreamError) {
ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html")); ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html"));
} }
// We run these tests with the audio service both in and out of the the browser
// process to have waterfall coverage while the feature rolls out. It should be
// removed after launch. Note: CastStreamingApiTestWithPixelOutput.EndToEnd is
// the only integration test exercising audio service loopback streams, so it's
// a very important test to have.
#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX) || \
defined(OS_WIN)
// Supported platforms.
INSTANTIATE_TEST_CASE_P(,
CastStreamingApiTestWithPixelOutput,
::testing::Bool());
#else
// Platforms where the out of process audio service isn't supported
INSTANTIATE_TEST_CASE_P(,
CastStreamingApiTestWithPixelOutput,
::testing::Values(false));
#endif
} // namespace extensions } // namespace extensions
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment