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/environment.h" | 5 #include "base/environment.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 return result; | 203 return result; |
204 } | 204 } |
205 | 205 |
206 void GetUserMedia(content::WebContents* tab_contents) { | 206 void GetUserMedia(content::WebContents* tab_contents) { |
207 content::WindowedNotificationObserver infobar_added( | 207 content::WindowedNotificationObserver infobar_added( |
208 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 208 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
209 content::NotificationService::AllSources()); | 209 content::NotificationService::AllSources()); |
210 | 210 |
211 // Request user media: this will launch the media stream info bar. | 211 // Request user media: this will launch the media stream info bar. |
212 EXPECT_EQ("ok-requested", | 212 EXPECT_EQ("ok-requested", |
213 ExecuteJavascript("getUserMedia('{video: true, audio: true}');", | 213 ExecuteJavascript("doGetUserMedia('{video: true, audio: true}');", |
214 tab_contents)); | 214 tab_contents)); |
215 | 215 |
216 // Wait for the bar to pop up, then accept. | 216 // Wait for the bar to pop up, then accept. |
217 infobar_added.Wait(); | 217 infobar_added.Wait(); |
218 content::Details<InfoBarAddedDetails> details(infobar_added.details()); | 218 content::Details<InfoBarAddedDetails> details(infobar_added.details()); |
219 MediaStreamInfoBarDelegate* media_infobar = | 219 MediaStreamInfoBarDelegate* media_infobar = |
220 details.ptr()->AsMediaStreamInfoBarDelegate(); | 220 details.ptr()->AsMediaStreamInfoBarDelegate(); |
221 media_infobar->Accept(); | 221 media_infobar->Accept(); |
222 | 222 |
223 // Wait for WebRTC to call the success callback. | 223 // Wait for WebRTC to call the success callback. |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 std::string output = | 518 std::string output = |
519 CompareVideos(kVgaWidth, | 519 CompareVideos(kVgaWidth, |
520 kVgaHeight, | 520 kVgaHeight, |
521 GetWorkingDir().Append(kCapturedYuvFileName), | 521 GetWorkingDir().Append(kCapturedYuvFileName), |
522 GetWorkingDir().Append(kReferenceYuvFileName), | 522 GetWorkingDir().Append(kReferenceYuvFileName), |
523 GetWorkingDir().Append(kStatsFileName)); | 523 GetWorkingDir().Append(kStatsFileName)); |
524 | 524 |
525 PrintFramesCountPerfResults(output); | 525 PrintFramesCountPerfResults(output); |
526 PrintPsnrAndSsimPerfResults(output); | 526 PrintPsnrAndSsimPerfResults(output); |
527 } | 527 } |
OLD | NEW |