| 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 | |
| 46 namespace { | 42 namespace { |
| 47 std::string MakeLabel(const char* test_name, const std::string& video_codec) { | 43 std::string MakeLabel(const char* test_name, const std::string& video_codec) { |
| 48 std::string codec_label = video_codec.empty() ? "" : "_" + video_codec; | 44 std::string codec_label = video_codec.empty() ? "" : "_" + video_codec; |
| 49 return base::StringPrintf("%s%s", test_name, codec_label.c_str()); | 45 return base::StringPrintf("%s%s", test_name, codec_label.c_str()); |
| 50 } | 46 } |
| 51 } // namespace | 47 } // namespace |
| 52 | 48 |
| 53 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = | 49 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = |
| 54 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 55 FILE_PATH_LITERAL("frame_analyzer.exe"); | 51 FILE_PATH_LITERAL("frame_analyzer.exe"); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 bool has_result_lines = output.find("RESULT") != std::string::npos; | 273 bool has_result_lines = output.find("RESULT") != std::string::npos; |
| 278 if (!ok || !has_result_lines) { | 274 if (!ok || !has_result_lines) { |
| 279 LOG(ERROR) << "Failed to compare videos; see output above to see what " | 275 LOG(ERROR) << "Failed to compare videos; see output above to see what " |
| 280 << "the error was."; | 276 << "the error was."; |
| 281 return false; | 277 return false; |
| 282 } | 278 } |
| 283 return true; | 279 return true; |
| 284 } | 280 } |
| 285 | 281 |
| 286 void TestVideoQuality(const std::string& video_codec) { | 282 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 | |
| 296 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) | 283 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) |
| 297 << "This is a long-running test; you must specify " | 284 << "This is a long-running test; you must specify " |
| 298 "--ui-test-action-max-timeout to have a value of at least 150000."; | 285 "--ui-test-action-max-timeout to have a value of at least 150000."; |
| 299 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); | 286 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); |
| 300 ASSERT_TRUE(embedded_test_server()->Start()); | 287 ASSERT_TRUE(embedded_test_server()->Start()); |
| 301 | 288 |
| 302 content::WebContents* left_tab = | 289 content::WebContents* left_tab = |
| 303 OpenPageAndGetUserMediaInNewTabWithConstraints( | 290 OpenPageAndGetUserMediaInNewTabWithConstraints( |
| 304 embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage), | 291 embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage), |
| 305 test_config_.constraints); | 292 test_config_.constraints); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { | 376 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
| 390 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " | 377 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " |
| 391 "Skipping WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264 " | 378 "Skipping WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264 " |
| 392 "(test \"OK\")"; | 379 "(test \"OK\")"; |
| 393 return; | 380 return; |
| 394 } | 381 } |
| 395 TestVideoQuality("H264"); | 382 TestVideoQuality("H264"); |
| 396 } | 383 } |
| 397 | 384 |
| 398 #endif // BUILDFLAG(RTC_USE_H264) | 385 #endif // BUILDFLAG(RTC_USE_H264) |
| OLD | NEW |