Index: content/browser/webrtc/webrtc_image_capture_browsertest.cc |
diff --git a/content/browser/webrtc/webrtc_image_capture_browsertest.cc b/content/browser/webrtc/webrtc_image_capture_browsertest.cc |
index 22b925ae4a5588977efe80a7e93007ef9e0bfebf..3209ab81ef650ae2f23c7b33c05e855fb026a5e1 100644 |
--- a/content/browser/webrtc/webrtc_image_capture_browsertest.cc |
+++ b/content/browser/webrtc/webrtc_image_capture_browsertest.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "base/command_line.h" |
+#include "base/test/scoped_feature_list.h" |
#include "build/build_config.h" |
#include "content/browser/webrtc/webrtc_webcam_browsertest.h" |
#include "content/public/common/content_switches.h" |
@@ -132,7 +133,13 @@ class WebRtcImageCaptureSucceedsBrowserTest |
public testing::WithParamInterface< |
std::tuple<TargetCamera, TargetVideoCaptureStack>> { |
public: |
- WebRtcImageCaptureSucceedsBrowserTest() = default; |
+ WebRtcImageCaptureSucceedsBrowserTest() { |
+ if (std::get<1>(GetParam()).use_video_capture_service) { |
+ scoped_feature_list_.InitAndEnableFeature( |
+ video_capture::kMojoVideoCapture); |
+ } |
+ } |
+ |
~WebRtcImageCaptureSucceedsBrowserTest() override = default; |
void SetUpCommandLine(base::CommandLine* command_line) override { |
@@ -144,10 +151,6 @@ class WebRtcImageCaptureSucceedsBrowserTest |
ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kUseFakeDeviceForMediaStream)); |
} |
- if (std::get<1>(GetParam()).use_video_capture_service) { |
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
- switches::kEnableFeatures, video_capture::kMojoVideoCapture.name); |
- } |
} |
bool RunImageCaptureTestCase(const std::string& command) override { |
@@ -161,6 +164,9 @@ class WebRtcImageCaptureSucceedsBrowserTest |
} |
return WebRtcImageCaptureBrowserTestBase::RunImageCaptureTestCase(command); |
} |
+ |
+ private: |
+ base::test::ScopedFeatureList scoped_feature_list_; |
}; |
IN_PROC_BROWSER_TEST_P(WebRtcImageCaptureSucceedsBrowserTest, |
@@ -219,17 +225,23 @@ class WebRtcImageCaptureCustomConfigFakeDeviceBrowserTest |
: public WebRtcImageCaptureBrowserTestBase, |
public testing::WithParamInterface<TargetVideoCaptureStack> { |
public: |
+ WebRtcImageCaptureCustomConfigFakeDeviceBrowserTest() { |
+ if (GetParam().use_video_capture_service) { |
+ scoped_feature_list_.InitAndEnableFeature( |
+ video_capture::kMojoVideoCapture); |
+ } |
+ } |
+ |
void SetUpCommandLine(base::CommandLine* command_line) override { |
WebRtcImageCaptureBrowserTestBase::SetUpCommandLine(command_line); |
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
switches::kUseFakeDeviceForMediaStream, |
std::string("config=") + FakeDeviceConfigTraits::config()); |
- if (GetParam().use_video_capture_service) { |
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
- switches::kEnableFeatures, video_capture::kMojoVideoCapture.name); |
- } |
} |
+ |
+ private: |
+ base::test::ScopedFeatureList scoped_feature_list_; |
}; |
struct GetPhotoStateFailsConfigTraits { |