OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 << " to evaluate to " << evaluates_to << "; last result was '" | 173 << " to evaluate to " << evaluates_to << "; last result was '" |
174 << result << "'"; | 174 << result << "'"; |
175 return false; | 175 return false; |
176 } | 176 } |
177 | 177 |
178 void GetUserMedia(const std::string& constraints, | 178 void GetUserMedia(const std::string& constraints, |
179 content::WebContents* tab_contents) { | 179 content::WebContents* tab_contents) { |
180 // Request user media: this will launch the media stream info bar. | 180 // Request user media: this will launch the media stream info bar. |
181 EXPECT_EQ("ok-requested", | 181 EXPECT_EQ("ok-requested", |
182 ExecuteJavascript( | 182 ExecuteJavascript( |
183 base::StringPrintf("getUserMedia(%s);", constraints.c_str()), | 183 base::StringPrintf("doGetUserMedia(%s);", |
184 tab_contents)); | 184 constraints.c_str()), tab_contents)); |
185 } | 185 } |
186 }; | 186 }; |
187 | 187 |
188 IN_PROC_BROWSER_TEST_F(MediaStreamInfobarTest, TestAllowingUserMedia) { | 188 IN_PROC_BROWSER_TEST_F(MediaStreamInfobarTest, TestAllowingUserMedia) { |
189 content::WebContents* tab_contents = LoadTestPageInTab(); | 189 content::WebContents* tab_contents = LoadTestPageInTab(); |
190 TestAcceptOnInfobar(tab_contents); | 190 TestAcceptOnInfobar(tab_contents); |
191 } | 191 } |
192 | 192 |
193 IN_PROC_BROWSER_TEST_F(MediaStreamInfobarTest, TestDenyingUserMedia) { | 193 IN_PROC_BROWSER_TEST_F(MediaStreamInfobarTest, TestDenyingUserMedia) { |
194 content::WebContents* tab_contents = LoadTestPageInTab(); | 194 content::WebContents* tab_contents = LoadTestPageInTab(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 content::WebContents* tab_contents = LoadTestPageInTab(); | 278 content::WebContents* tab_contents = LoadTestPageInTab(); |
279 | 279 |
280 // If microphone blocking also blocked a AV call, the second call here | 280 // If microphone blocking also blocked a AV call, the second call here |
281 // would hang. The requester should only be granted access to the cam though. | 281 // would hang. The requester should only be granted access to the cam though. |
282 TestDenyWithSpecificConstraints(tab_contents, kAudioOnlyCallConstraints); | 282 TestDenyWithSpecificConstraints(tab_contents, kAudioOnlyCallConstraints); |
283 TestAcceptOnInfobarWithSpecificConstraints(tab_contents, | 283 TestAcceptOnInfobarWithSpecificConstraints(tab_contents, |
284 kAudioVideoCallConstraints); | 284 kAudioVideoCallConstraints); |
285 | 285 |
286 // TODO(phoglund): verify the requester actually only gets video tracks. | 286 // TODO(phoglund): verify the requester actually only gets video tracks. |
287 } | 287 } |
OLD | NEW |