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

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: Enable test on android with one exception. 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
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 crbug.com/585242 is fixed, enable peer connection
mcasas 2016/04/22 23:14:13 http://crbug.com/...
cpaulin (no longer in chrome) 2016/04/22 23:25:52 Done.
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"; 24 static const char kBlinkFeaturesNeeded[] = "GetUserMedia";
25 25
26 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html"; 26 static const char kMediaRecorderHtmlFile[] = "/media/mediarecorder_test.html";
27 27
28 } // namespace 28 } // namespace
29 29
30 namespace content { 30 namespace content {
31
31 // This class tests the recording of a media stream. 32 // This class tests the recording of a media stream.
32 class MAYBE_WebRtcMediaRecorderTest : public WebRtcContentBrowserTest { 33 class WebRtcMediaRecorderTest : public WebRtcContentBrowserTest {
33 public: 34 public:
34 MAYBE_WebRtcMediaRecorderTest() {} 35 WebRtcMediaRecorderTest() {}
35 ~MAYBE_WebRtcMediaRecorderTest() override {} 36 ~WebRtcMediaRecorderTest() override {}
36 37
37 void SetUpCommandLine(base::CommandLine* command_line) override { 38 void SetUpCommandLine(base::CommandLine* command_line) override {
38 WebRtcContentBrowserTest::SetUpCommandLine(command_line); 39 WebRtcContentBrowserTest::SetUpCommandLine(command_line);
39 40
40 // Turn on the flags we need. 41 // Turn on the flags we need.
mcasas 2016/04/22 23:14:12 nit: Remove this comment.
cpaulin (no longer in chrome) 2016/04/22 23:25:52 Done.
41 AppendUseFakeUIForMediaStreamFlag(); 42 AppendUseFakeUIForMediaStreamFlag();
42 43
43 base::CommandLine::ForCurrentProcess()->AppendSwitch( 44 base::CommandLine::ForCurrentProcess()->AppendSwitch(
44 switches::kUseFakeDeviceForMediaStream); 45 switches::kUseFakeDeviceForMediaStream);
45 46
46 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 47 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
47 switches::kEnableBlinkFeatures, kBlinkFeaturesNeeded); 48 switches::kEnableBlinkFeatures, kBlinkFeaturesNeeded);
mcasas 2016/04/22 23:14:12 nit: inline "GetUserMedia" here, no need to extrac
cpaulin (no longer in chrome) 2016/04/22 23:25:52 Done.
48 } 49 }
49 50
50 private: 51 private:
51 DISALLOW_COPY_AND_ASSIGN(MAYBE_WebRtcMediaRecorderTest); 52 DISALLOW_COPY_AND_ASSIGN(WebRtcMediaRecorderTest);
52 }; 53 };
53 54
54 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderStart) { 55 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStart) {
55 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile); 56 MakeTypicalCall("testStartAndRecorderState();", kMediaRecorderHtmlFile);
56 } 57 }
57 58
58 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 59 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderStartAndStop) {
59 MediaRecorderStartAndStop) {
60 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile); 60 MakeTypicalCall("testStartStopAndRecorderState();", kMediaRecorderHtmlFile);
61 } 61 }
62 62
63 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 63 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
64 MediaRecorderStartAndDataAvailable) { 64 MediaRecorderStartAndDataAvailable) {
65 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile); 65 MakeTypicalCall("testStartAndDataAvailable();", kMediaRecorderHtmlFile);
66 } 66 }
67 67
68 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 68 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
69 MediaRecorderStartWithTimeSlice) { 69 MediaRecorderStartWithTimeSlice) {
70 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile); 70 MakeTypicalCall("testStartWithTimeSlice();", kMediaRecorderHtmlFile);
71 } 71 }
72 72
73 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, MediaRecorderResume) { 73 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderResume) {
74 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile); 74 MakeTypicalCall("testResumeAndRecorderState();", kMediaRecorderHtmlFile);
75 } 75 }
76 76
77 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 77 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
78 MediaRecorderNoResumeWhenRecorderInactive) { 78 MediaRecorderNoResumeWhenRecorderInactive) {
79 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile); 79 MakeTypicalCall("testIllegalResumeThrowsDOMError();", kMediaRecorderHtmlFile);
80 } 80 }
81 81
82 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 82 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
83 MediaRecorderResumeAndDataAvailable) { 83 MediaRecorderResumeAndDataAvailable) {
84 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile); 84 MakeTypicalCall("testResumeAndDataAvailable();", kMediaRecorderHtmlFile);
85 } 85 }
86 86
87 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 87 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPause) {
88 MediaRecorderPause) {
89 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile); 88 MakeTypicalCall("testPauseAndRecorderState();", kMediaRecorderHtmlFile);
90 } 89 }
91 90
92 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 91 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest, MediaRecorderPauseStop) {
93 MediaRecorderPauseStop) {
94 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile); 92 MakeTypicalCall("testPauseStopAndRecorderState();", kMediaRecorderHtmlFile);
95 } 93 }
96 94
97 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 95 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
98 MediaRecorderPausePreventsDataavailableFromBeingFired) { 96 MediaRecorderPausePreventsDataavailableFromBeingFired) {
99 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();", 97 MakeTypicalCall("testPausePreventsDataavailableFromBeingFired();",
100 kMediaRecorderHtmlFile); 98 kMediaRecorderHtmlFile);
101 } 99 }
102 100
103 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 101 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
104 MediaRecorderIllegalPauseThrowsDOMError) { 102 MediaRecorderIllegalPauseThrowsDOMError) {
105 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile); 103 MakeTypicalCall("testIllegalPauseThrowsDOMError();", kMediaRecorderHtmlFile);
106 } 104 }
107 105
108 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 106 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
109 MediaRecorderTwoChannelAudioRecording) { 107 MediaRecorderTwoChannelAudioRecording) {
110 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile); 108 MakeTypicalCall("testTwoChannelAudio();", kMediaRecorderHtmlFile);
111 } 109 }
112 110
113 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 111 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
114 MediaRecorderIllegalStopThrowsDOMError) { 112 MediaRecorderIllegalStopThrowsDOMError) {
115 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile); 113 MakeTypicalCall("testIllegalStopThrowsDOMError();", kMediaRecorderHtmlFile);
116 } 114 }
117 115
118 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 116 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
119 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) { 117 MediaRecorderIllegalStartWhileRecordingThrowsDOMError) {
120 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();", 118 MakeTypicalCall("testIllegalStartInRecordingStateThrowsDOMError();",
121 kMediaRecorderHtmlFile); 119 kMediaRecorderHtmlFile);
122 } 120 }
123 121
124 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 122 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
125 MediaRecorderIllegalStartWhilePausedThrowsDOMError) { 123 MediaRecorderIllegalStartWhilePausedThrowsDOMError) {
126 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();", 124 MakeTypicalCall("testIllegalStartInPausedStateThrowsDOMError();",
127 kMediaRecorderHtmlFile); 125 kMediaRecorderHtmlFile);
128 } 126 }
129 127
130 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 128 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
131 MediaRecorderIllegalRequestDataThrowsDOMError) { 129 MediaRecorderIllegalRequestDataThrowsDOMError) {
132 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();", 130 MakeTypicalCall("testIllegalRequestDataThrowsDOMError();",
133 kMediaRecorderHtmlFile); 131 kMediaRecorderHtmlFile);
134 } 132 }
135 133
136 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 134 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
137 MediaRecorderPeerConnection) { 135 MAYBE_MediaRecorderPeerConnection) {
138 MakeTypicalCall("testRecordRemotePeerConnection();", kMediaRecorderHtmlFile); 136 MakeTypicalCall("testRecordRemotePeerConnection();", kMediaRecorderHtmlFile);
139 } 137 }
140 138
141 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 139 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
142 AddingTrackToMediaStreamFiresErrorEvent) { 140 AddingTrackToMediaStreamFiresErrorEvent) {
143 MakeTypicalCall("testAddingTrackToMediaStreamFiresErrorEvent();", 141 MakeTypicalCall("testAddingTrackToMediaStreamFiresErrorEvent();",
144 kMediaRecorderHtmlFile); 142 kMediaRecorderHtmlFile);
145 } 143 }
146 144
147 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcMediaRecorderTest, 145 IN_PROC_BROWSER_TEST_F(WebRtcMediaRecorderTest,
148 RemovingTrackFromMediaStreamFiresErrorEvent) { 146 RemovingTrackFromMediaStreamFiresErrorEvent) {
149 MakeTypicalCall("testRemovingTrackFromMediaStreamFiresErrorEvent();", 147 MakeTypicalCall("testRemovingTrackFromMediaStreamFiresErrorEvent();",
150 kMediaRecorderHtmlFile); 148 kMediaRecorderHtmlFile);
151 } 149 }
152 150
153 } // namespace content 151 } // 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