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

Side by Side Diff: content/browser/media/webrtc/webrtc_media_recorder_browsertest.cc

Issue 1912853004: Media Recorder: Enable content browser test on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mcasas@'s comments. Created 4 years, 8 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 | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/macros.h" 6 #include "base/macros.h"
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/public/common/content_switches.h" 8 #include "content/public/common/content_switches.h"
9 #include "content/public/test/browser_test_utils.h" 9 #include "content/public/test/browser_test_utils.h"
10 #include "content/public/test/content_browser_test_utils.h" 10 #include "content/public/test/content_browser_test_utils.h"
11 #include "content/test/webrtc_content_browsertest_base.h" 11 #include "content/test/webrtc_content_browsertest_base.h"
12 #include "media/base/media_switches.h" 12 #include "media/base/media_switches.h"
13 13
phoglund_chromium 2016/04/25 06:40:00 Move this down to the test method now that it just
cpaulin (no longer in chrome) 2016/04/29 17:13:38 I am not sure I understand what you want: usually
14 #if defined(OS_ANDROID) 14 #if defined(OS_ANDROID)
15 // TODO(cpaulin): when crbug.com/561068 is fixed, enable this test 15 // TODO(cpaulin): when http://crbug.com/585242 is fixed, enable peer connection
16 // on android platform. 16 // recording test on android platform.
17 #define MAYBE_WebRtcMediaRecorderTest DISABLED_WebRtcMediaRecorderTest 17 #define MAYBE_MediaRecorderPeerConnection DISABLED_MediaRecorderPeerConnection
18 #else 18 #else
19 #define MAYBE_WebRtcMediaRecorderTest WebRtcMediaRecorderTest 19 #define MAYBE_MediaRecorderPeerConnection MediaRecorderPeerConnection
20 #endif 20 #endif
21 21
22 namespace { 22 namespace {
23 23
24 static const char kBlinkFeaturesNeeded[] = "GetUserMedia";
25
26 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html"; 24 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html";
27 25
28 } // namespace 26 } // namespace
29 27
30 namespace content { 28 namespace content {
29
31 // This class tests the recording of a media stream. 30 // This class tests the recording of a media stream.
32 class MAYBE_WebRtcMediaRecorderTest : public WebRtcContentBrowserTest { 31 class WebRtcMediaRecorderTest : public WebRtcContentBrowserTest {
33 public: 32 public:
34 MAYBE_WebRtcMediaRecorderTest() {} 33 WebRtcMediaRecorderTest() {}
35 ~MAYBE_WebRtcMediaRecorderTest() override {} 34 ~WebRtcMediaRecorderTest() override {}
36 35
37 void SetUpCommandLine(base::CommandLine* command_line) override { 36 void SetUpCommandLine(base::CommandLine* command_line) override {
38 WebRtcContentBrowserTest::SetUpCommandLine(command_line); 37 WebRtcContentBrowserTest::SetUpCommandLine(command_line);
39 38
40 // Turn on the flags we need.
41 AppendUseFakeUIForMediaStreamFlag(); 39 AppendUseFakeUIForMediaStreamFlag();
42 40
43 base::CommandLine::ForCurrentProcess()->AppendSwitch( 41 base::CommandLine::ForCurrentProcess()->AppendSwitch(
44 switches::kUseFakeDeviceForMediaStream); 42 switches::kUseFakeDeviceForMediaStream);
45 43
46 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 44 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
47 switches::kEnableBlinkFeatures, kBlinkFeaturesNeeded); 45 switches::kEnableBlinkFeatures, "GetUserMedia");
48 } 46 }
49 47
50 private: 48 private:
51 DISALLOW_COPY_AND_ASSIGN(MAYBE_WebRtcMediaRecorderTest); 49 DISALLOW_COPY_AND_ASSIGN(WebRtcMediaRecorderTest);
52 }; 50 };
53 51
54 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderStart) { 52 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStart) {
55 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile); 53 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile);
56 } 54 }
57 55
58 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 56 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStartAndStop) {
59 MediaRecorderStartAndStop) {
60 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile); 57 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile);
61 } 58 }
62 59
63 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 60 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
64 MediaRecorderStartAndDataAvailable) { 61 MediaRecorderStartAndDataAvailable) {
65 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile); 62 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile);
66 } 63 }
67 64
68 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 65 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
69 MediaRecorderStartWithTimeSlice) { 66 MediaRecorderStartWithTimeSlice) {
70 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile); 67 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile);
71 } 68 }
72 69
73 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderResume) { 70 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderResume) {
74 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile); 71 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile);
75 } 72 }
76 73
77 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 74 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
78 MediaRecorderNoResumeWhenRecorderInactive) { 75 MediaRecorderNoResumeWhenRecorderInactive) {
79 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile); 76 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile);
80 } 77 }
81 78
82 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 79 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
83 MediaRecorderResumeAndDataAvailable) { 80 MediaRecorderResumeAndDataAvailable) {
84 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile); 81 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile);
85 } 82 }
86 83
87 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 84 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPause) {
88 MediaRecorderPause) {
89 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile); 85 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile);
90 } 86 }
91 87
92 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 88 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPauseStop) {
93 MediaRecorderPauseStop) {
94 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile); 89 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile);
95 } 90 }
96 91
97 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 92 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
98 MediaRecorderPausePreventsDataavailableFromBeingFired) { 93 MediaRecorderPausePreventsDataavailableFromBeingFired) {
99 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();", 94 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();",
100 kMediaRecorderHtmlFile); 95 kMediaRecorderHtmlFile);
101 } 96 }
102 97
103 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 98 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
104 MediaRecorderIllegalPauseThrowsDOMError) { 99 MediaRecorderIllegalPauseThrowsDOMError) {
105 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile); 100 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile);
106 } 101 }
107 102
108 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 103 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
109 MediaRecorderTwoChannelAudioRecording) { 104 MediaRecorderTwoChannelAudioRecording) {
110 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile); 105 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile);
111 } 106 }
112 107
113 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 108 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
114 MediaRecorderIllegalStopThrowsDOMError) { 109 MediaRecorderIllegalStopThrowsDOMError) {
115 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile); 110 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile);
116 } 111 }
117 112
118 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 113 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
119 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) { 114 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) {
120 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();", 115 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();",
121 kMediaRecorderHtmlFile); 116 kMediaRecorderHtmlFile);
122 } 117 }
123 118
124 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 119 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
125 MediaRecorderIllegalStartWhilePausedThrowsDOMError) { 120 MediaRecorderIllegalStartWhilePausedThrowsDOMError) {
126 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();", 121 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();",
127 kMediaRecorderHtmlFile); 122 kMediaRecorderHtmlFile);
128 } 123 }
129 124
130 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 125 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
131 MediaRecorderIllegalRequestDataThrowsDOMError) { 126 MediaRecorderIllegalRequestDataThrowsDOMError) {
132 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();", 127 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();",
133 kMediaRecorderHtmlFile); 128 kMediaRecorderHtmlFile);
134 } 129 }
135 130
136 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 131 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
137 MediaRecorderPeerConnection) { 132 MAYBE_MediaRecorderPeerConnection) {
138 MakeTypicalCall("testRecordRemotePeerConnection();", kMediaRecorderHtmlFile); 133 MakeTypicalCall("testRecordRemotePeerConnection();", kMediaRecorderHtmlFile);
139 } 134 }
140 135
141 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 136 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
142 AddingTrackToMediaStreamFiresErrorEvent) { 137 AddingTrackToMediaStreamFiresErrorEvent) {
143 MakeTypicalCall("testAddingTrackToMediaStreamFiresErrorEvent();", 138 MakeTypicalCall("testAddingTrackToMediaStreamFiresErrorEvent();",
144 kMediaRecorderHtmlFile); 139 kMediaRecorderHtmlFile);
145 } 140 }
146 141
147 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 142 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
148 RemovingTrackFromMediaStreamFiresErrorEvent) { 143 RemovingTrackFromMediaStreamFiresErrorEvent) {
149 MakeTypicalCall("testRemovingTrackFromMediaStreamFiresErrorEvent();", 144 MakeTypicalCall("testRemovingTrackFromMediaStreamFiresErrorEvent();",
150 kMediaRecorderHtmlFile); 145 kMediaRecorderHtmlFile);
151 } 146 }
152 147
153 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698