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

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 nit from phoglund@. Created 4 years, 7 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
14 #if defined(OS_ANDROID)
15 // TODO(cpaulin): when crbug.com/561068 is fixed, enable this test
16 // on android platform.
17 #define MAYBE_WebRtcMediaRecorderTest DISABLED_WebRtcMediaRecorderTest
18 #else
19 #define MAYBE_WebRtcMediaRecorderTest WebRtcMediaRecorderTest
20 #endif
21
22 namespace { 14 namespace {
23 15
24 static const char kBlinkFeaturesNeeded[] = "GetUserMedia";
25
26 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html"; 16 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html";
27 17
28 } // namespace 18 } // namespace
29 19
30 namespace content { 20 namespace content {
21
31 // This class tests the recording of a media stream. 22 // This class tests the recording of a media stream.
32 class MAYBE_WebRtcMediaRecorderTest : public WebRtcContentBrowserTest { 23 class WebRtcMediaRecorderTest : public WebRtcContentBrowserTest {
33 public: 24 public:
34 MAYBE_WebRtcMediaRecorderTest() {} 25 WebRtcMediaRecorderTest() {}
35 ~MAYBE_WebRtcMediaRecorderTest() override {} 26 ~WebRtcMediaRecorderTest() override {}
36 27
37 void SetUpCommandLine(base::CommandLine* command_line) override { 28 void SetUpCommandLine(base::CommandLine* command_line) override {
38 WebRtcContentBrowserTest::SetUpCommandLine(command_line); 29 WebRtcContentBrowserTest::SetUpCommandLine(command_line);
39 30
40 // Turn on the flags we need.
41 AppendUseFakeUIForMediaStreamFlag(); 31 AppendUseFakeUIForMediaStreamFlag();
42 32
43 base::CommandLine::ForCurrentProcess()->AppendSwitch( 33 base::CommandLine::ForCurrentProcess()->AppendSwitch(
44 switches::kUseFakeDeviceForMediaStream); 34 switches::kUseFakeDeviceForMediaStream);
45 35
46 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 36 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
47 switches::kEnableBlinkFeatures, kBlinkFeaturesNeeded); 37 switches::kEnableBlinkFeatures, "GetUserMedia");
48 } 38 }
49 39
50 private: 40 private:
51 DISALLOW_COPY_AND_ASSIGN(MAYBE_WebRtcMediaRecorderTest); 41 DISALLOW_COPY_AND_ASSIGN(WebRtcMediaRecorderTest);
52 }; 42 };
53 43
54 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderStart) { 44 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStart) {
55 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile); 45 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile);
56 } 46 }
57 47
58 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 48 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStartAndStop) {
59 MediaRecorderStartAndStop) {
60 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile); 49 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile);
61 } 50 }
62 51
63 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 52 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
64 MediaRecorderStartAndDataAvailable) { 53 MediaRecorderStartAndDataAvailable) {
65 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile); 54 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile);
66 } 55 }
67 56
68 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 57 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
69 MediaRecorderStartWithTimeSlice) { 58 MediaRecorderStartWithTimeSlice) {
70 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile); 59 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile);
71 } 60 }
72 61
73 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderResume) { 62 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderResume) {
74 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile); 63 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile);
75 } 64 }
76 65
77 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 66 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
78 MediaRecorderNoResumeWhenRecorderInactive) { 67 MediaRecorderNoResumeWhenRecorderInactive) {
79 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile); 68 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile);
80 } 69 }
81 70
82 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 71 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
83 MediaRecorderResumeAndDataAvailable) { 72 MediaRecorderResumeAndDataAvailable) {
84 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile); 73 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile);
85 } 74 }
86 75
87 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 76 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPause) {
88 MediaRecorderPause) {
89 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile); 77 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile);
90 } 78 }
91 79
92 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 80 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPauseStop) {
93 MediaRecorderPauseStop) {
94 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile); 81 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile);
95 } 82 }
96 83
97 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 84 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
98 MediaRecorderPausePreventsDataavailableFromBeingFired) { 85 MediaRecorderPausePreventsDataavailableFromBeingFired) {
99 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();", 86 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();",
100 kMediaRecorderHtmlFile); 87 kMediaRecorderHtmlFile);
101 } 88 }
102 89
103 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 90 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
104 MediaRecorderIllegalPauseThrowsDOMError) { 91 MediaRecorderIllegalPauseThrowsDOMError) {
105 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile); 92 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile);
106 } 93 }
107 94
108 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 95 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
109 MediaRecorderTwoChannelAudioRecording) { 96 MediaRecorderTwoChannelAudioRecording) {
110 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile); 97 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile);
111 } 98 }
112 99
113 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 100 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
114 MediaRecorderIllegalStopThrowsDOMError) { 101 MediaRecorderIllegalStopThrowsDOMError) {
115 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile); 102 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile);
116 } 103 }
117 104
118 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 105 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
119 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) { 106 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) {
120 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();", 107 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();",
121 kMediaRecorderHtmlFile); 108 kMediaRecorderHtmlFile);
122 } 109 }
123 110
124 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 111 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
125 MediaRecorderIllegalStartWhilePausedThrowsDOMError) { 112 MediaRecorderIllegalStartWhilePausedThrowsDOMError) {
126 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();", 113 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();",
127 kMediaRecorderHtmlFile); 114 kMediaRecorderHtmlFile);
128 } 115 }
129 116
130 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 117 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
131 MediaRecorderIllegalRequestDataThrowsDOMError) { 118 MediaRecorderIllegalRequestDataThrowsDOMError) {
132 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();", 119 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();",
133 kMediaRecorderHtmlFile); 120 kMediaRecorderHtmlFile);
134 } 121 }
135 122
136 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 123 #if defined(OS_ANDROID)
137 MediaRecorderPeerConnection) { 124 // TODO(cpaulin): when http://crbug.com/585242 is fixed, enable peer connection
125 // recording test on android platform.
126 #define MAYBE_MediaRecorderPeerConnection DISABLED_MediaRecorderPeerConnection
127 #else
128 #define MAYBE_MediaRecorderPeerConnection MediaRecorderPeerConnection
129 #endif
130
131 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
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