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

Side by Side Diff: content/browser/webrtc/webrtc_video_capture_browsertest.cc

Issue 2910843002: [Cleanup] Move all browsertests to use ScopedFeatureList to modify features
Patch Set: Move SFL calls to constructor Created 3 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 unified diff | Download patch
« no previous file with comments | « content/browser/webrtc/webrtc_image_capture_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/test/scoped_feature_list.h"
6 #include "build/build_config.h" 7 #include "build/build_config.h"
7 #include "content/browser/webrtc/webrtc_webcam_browsertest.h" 8 #include "content/browser/webrtc/webrtc_webcam_browsertest.h"
8 #include "content/public/browser/browser_child_process_host.h" 9 #include "content/public/browser/browser_child_process_host.h"
9 #include "content/public/common/child_process_host.h" 10 #include "content/public/common/child_process_host.h"
10 #include "content/public/common/content_switches.h" 11 #include "content/public/common/content_switches.h"
11 #include "content/public/common/service_manager_connection.h" 12 #include "content/public/common/service_manager_connection.h"
12 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/content_browser_test_utils.h" 14 #include "content/public/test/content_browser_test_utils.h"
14 #include "content/shell/browser/shell.h" 15 #include "content/shell/browser/shell.h"
15 #include "media/base/media_switches.h" 16 #include "media/base/media_switches.h"
(...skipping 23 matching lines...) Expand all
39 static const char kWaitForVideoToTurnBlack[] = "waitForVideoToTurnBlack()"; 40 static const char kWaitForVideoToTurnBlack[] = "waitForVideoToTurnBlack()";
40 static const char kVerifyHasReceivedTrackEndedEvent[] = 41 static const char kVerifyHasReceivedTrackEndedEvent[] =
41 "verifyHasReceivedTrackEndedEvent()"; 42 "verifyHasReceivedTrackEndedEvent()";
42 43
43 } // anonymous namespace 44 } // anonymous namespace
44 45
45 // Integration test that exercises video capture functionality from the 46 // Integration test that exercises video capture functionality from the
46 // JavaScript level. 47 // JavaScript level.
47 class WebRtcVideoCaptureBrowserTest : public ContentBrowserTest { 48 class WebRtcVideoCaptureBrowserTest : public ContentBrowserTest {
48 protected: 49 protected:
50 WebRtcVideoCaptureBrowserTest() {
51 scoped_feature_list_.InitAndEnableFeature(video_capture::kMojoVideoCapture);
52 }
53
49 void SetUpCommandLine(base::CommandLine* command_line) override { 54 void SetUpCommandLine(base::CommandLine* command_line) override {
50 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); 55 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);
51 command_line->AppendSwitchASCII(switches::kEnableFeatures,
52 video_capture::kMojoVideoCapture.name);
53 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); 56 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
54 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 57 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
55 switches::kEnableBlinkFeatures, "GetUserMedia"); 58 switches::kEnableBlinkFeatures, "GetUserMedia");
56 } 59 }
57 60
58 void SetUp() override { 61 void SetUp() override {
59 ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); 62 ASSERT_TRUE(embedded_test_server()->InitializeAndListen());
60 EnablePixelOutput(); 63 EnablePixelOutput();
61 ContentBrowserTest::SetUp(); 64 ContentBrowserTest::SetUp();
62 } 65 }
66
67 private:
68 base::test::ScopedFeatureList scoped_feature_list_;
63 }; 69 };
64 70
65 IN_PROC_BROWSER_TEST_F(WebRtcVideoCaptureBrowserTest, 71 IN_PROC_BROWSER_TEST_F(WebRtcVideoCaptureBrowserTest,
66 MAYBE_RecoverFromCrashInVideoCaptureProcess) { 72 MAYBE_RecoverFromCrashInVideoCaptureProcess) {
67 embedded_test_server()->StartAcceptingConnections(); 73 embedded_test_server()->StartAcceptingConnections();
68 GURL url(embedded_test_server()->GetURL(kVideoCaptureHtmlFile)); 74 GURL url(embedded_test_server()->GetURL(kVideoCaptureHtmlFile));
69 NavigateToURL(shell(), url); 75 NavigateToURL(shell(), url);
70 76
71 std::string result; 77 std::string result;
72 // Start video capture and wait until it started rendering 78 // Start video capture and wait until it started rendering
(...skipping 17 matching lines...) Expand all
90 shell(), kVerifyHasReceivedTrackEndedEvent, &result)); 96 shell(), kVerifyHasReceivedTrackEndedEvent, &result));
91 ASSERT_EQ("OK", result); 97 ASSERT_EQ("OK", result);
92 98
93 // Start capturing again and expect it to work. 99 // Start capturing again and expect it to work.
94 ASSERT_TRUE(ExecuteScriptAndExtractString( 100 ASSERT_TRUE(ExecuteScriptAndExtractString(
95 shell(), kStartVideoCaptureAndVerifySize, &result)); 101 shell(), kStartVideoCaptureAndVerifySize, &result));
96 ASSERT_EQ("OK", result); 102 ASSERT_EQ("OK", result);
97 } 103 }
98 104
99 } // namespace content 105 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webrtc/webrtc_image_capture_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698