| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
| 33 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" | 33 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" |
| 34 #include "content/public/common/features.h" | 34 #include "content/public/common/features.h" |
| 35 #include "content/public/test/browser_test_utils.h" | 35 #include "content/public/test/browser_test_utils.h" |
| 36 #include "media/base/media_switches.h" | 36 #include "media/base/media_switches.h" |
| 37 #include "net/test/embedded_test_server/embedded_test_server.h" | 37 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 38 #include "net/test/python_utils.h" | 38 #include "net/test/python_utils.h" |
| 39 #include "testing/perf/perf_test.h" | 39 #include "testing/perf/perf_test.h" |
| 40 #include "ui/gl/gl_switches.h" | 40 #include "ui/gl/gl_switches.h" |
| 41 | 41 |
| 42 #if defined(OS_WIN) |
| 43 #include "base/win/windows_version.h" |
| 44 #endif |
| 45 |
| 42 namespace { | 46 namespace { |
| 43 std::string MakeLabel(const char* test_name, const std::string& video_codec) { | 47 std::string MakeLabel(const char* test_name, const std::string& video_codec) { |
| 44 std::string codec_label = video_codec.empty() ? "" : "_" + video_codec; | 48 std::string codec_label = video_codec.empty() ? "" : "_" + video_codec; |
| 45 return base::StringPrintf("%s%s", test_name, codec_label.c_str()); | 49 return base::StringPrintf("%s%s", test_name, codec_label.c_str()); |
| 46 } | 50 } |
| 47 } // namespace | 51 } // namespace |
| 48 | 52 |
| 49 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = | 53 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = |
| 50 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
| 51 FILE_PATH_LITERAL("frame_analyzer.exe"); | 55 FILE_PATH_LITERAL("frame_analyzer.exe"); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 bool has_result_lines = output.find("RESULT") != std::string::npos; | 277 bool has_result_lines = output.find("RESULT") != std::string::npos; |
| 274 if (!ok || !has_result_lines) { | 278 if (!ok || !has_result_lines) { |
| 275 LOG(ERROR) << "Failed to compare videos; see output above to see what " | 279 LOG(ERROR) << "Failed to compare videos; see output above to see what " |
| 276 << "the error was."; | 280 << "the error was."; |
| 277 return false; | 281 return false; |
| 278 } | 282 } |
| 279 return true; | 283 return true; |
| 280 } | 284 } |
| 281 | 285 |
| 282 void TestVideoQuality(const std::string& video_codec) { | 286 void TestVideoQuality(const std::string& video_codec) { |
| 287 #if defined(OS_WIN) |
| 288 // Too slow for bots with bad GL config: see http://crbug.com/613947. |
| 289 bool is_hd = test_config_.width >= 1024; |
| 290 if (is_hd && base::win::GetVersion() == base::win::VERSION_WIN7) { |
| 291 LOG(WARNING) << "Skipping HD test on Win7."; |
| 292 return; |
| 293 } |
| 294 #endif |
| 295 |
| 283 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) | 296 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) |
| 284 << "This is a long-running test; you must specify " | 297 << "This is a long-running test; you must specify " |
| 285 "--ui-test-action-max-timeout to have a value of at least 150000."; | 298 "--ui-test-action-max-timeout to have a value of at least 150000."; |
| 286 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); | 299 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); |
| 287 ASSERT_TRUE(embedded_test_server()->Start()); | 300 ASSERT_TRUE(embedded_test_server()->Start()); |
| 288 | 301 |
| 289 content::WebContents* left_tab = | 302 content::WebContents* left_tab = |
| 290 OpenPageAndGetUserMediaInNewTabWithConstraints( | 303 OpenPageAndGetUserMediaInNewTabWithConstraints( |
| 291 embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage), | 304 embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage), |
| 292 test_config_.constraints); | 305 test_config_.constraints); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { | 389 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
| 377 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " | 390 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " |
| 378 "Skipping WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264 " | 391 "Skipping WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264 " |
| 379 "(test \"OK\")"; | 392 "(test \"OK\")"; |
| 380 return; | 393 return; |
| 381 } | 394 } |
| 382 TestVideoQuality("H264"); | 395 TestVideoQuality("H264"); |
| 383 } | 396 } |
| 384 | 397 |
| 385 #endif // BUILDFLAG(RTC_USE_H264) | 398 #endif // BUILDFLAG(RTC_USE_H264) |
| OLD | NEW |