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

Unified Diff: content/browser/media/webrtc/webrtc_webcam_browsertest.cc

Issue 2190523004: ImageCapture: content_browsertest WebRtcImageCaptureBrowserTest CreateAndGetCapabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test entry for real-world capture device, leaving just FakeVCD Created 4 years, 5 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 | « content/browser/media/webrtc/webrtc_webcam_browsertest.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc/webrtc_webcam_browsertest.cc
diff --git a/content/browser/media/webrtc/webrtc_webcam_browsertest.cc b/content/browser/media/webrtc/webrtc_webcam_browsertest.cc
index d1269c972aaac620dd11079df2976f109835ae91..5f9d7c36e8a73a908bf73973ce2dd0ee8762a53f 100644
--- a/content/browser/media/webrtc/webrtc_webcam_browsertest.cc
+++ b/content/browser/media/webrtc/webrtc_webcam_browsertest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/browser/media/webrtc/webrtc_webcam_browsertest.h"
+
#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -40,31 +42,25 @@ void RemoveFakeDeviceFromCommandLine(base::CommandLine* command_line) {
namespace content {
-// This class doesn't inherit from WebRtcContentBrowserTestBase like the others
-// since we want it to actually acquire the real webcam on the system (if there
-// is one).
-class WebRtcWebcamBrowserTest: public ContentBrowserTest {
- public:
- ~WebRtcWebcamBrowserTest() override {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
- command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
-
- // The content_browsertests run with this flag by default, and this test is
- // the only current exception to that rule, so just remove the flag
- // --use-fake-device-for-media-stream here. We could also have all tests
- // involving media streams add this flag explicitly, but it will be really
- // unintuitive for developers to write tests involving media stream and have
- // them fail on what looks like random bots, so running with fake devices
- // is really a reasonable default.
- RemoveFakeDeviceFromCommandLine(command_line);
- }
+void WebRtcWebcamBrowserTest::SetUpCommandLine(
+ base::CommandLine* command_line) {
+ // Allows for accessing capture devices without prompting for permission.
+ command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
+
+ // The content_browsertests run with this flag by default, and this test is
+ // the only current exception to that rule, so just remove the flag
+ // --use-fake-device-for-media-stream here. We could also have all tests
+ // involving media streams add this flag explicitly, but it will be really
+ // unintuitive for developers to write tests involving media stream and have
+ // them fail on what looks like random bots, so running with fake devices
+ // is really a reasonable default.
+ RemoveFakeDeviceFromCommandLine(command_line);
+}
- void SetUp() override {
- EnablePixelOutput();
- ContentBrowserTest::SetUp();
- }
-};
+void WebRtcWebcamBrowserTest::SetUp() {
+ EnablePixelOutput();
+ ContentBrowserTest::SetUp();
+}
// The test is tagged as MANUAL since the webcam is a system-level resource; we
// only want it to run on bots where we can ensure sequential execution. The
« no previous file with comments | « content/browser/media/webrtc/webrtc_webcam_browsertest.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698