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/base64.h" | 5 #include "base/base64.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 static const struct VideoQualityTestConfig { | 61 static const struct VideoQualityTestConfig { |
62 const char* test_name; | 62 const char* test_name; |
63 int width; | 63 int width; |
64 int height; | 64 int height; |
65 const base::FilePath::CharType* reference_video; | 65 const base::FilePath::CharType* reference_video; |
66 const char* constraints; | 66 const char* constraints; |
67 } kVideoConfigurations[] = { | 67 } kVideoConfigurations[] = { |
68 { "360p", 640, 360, | 68 { "360p", 640, 360, |
69 test::kReferenceFileName360p, | 69 test::kReferenceFileName360p, |
70 WebRtcTestBase::kAudioVideoCallConstraints360p }, | 70 WebRtcTestBase::kAudioVideoCallConstraints360p }, |
| 71 // TODO(phoglund): Temporarily disabled on Windows because 720p has become |
| 72 // very, very slow on Windows (550s). |
| 73 // See https://code.google.com/p/webrtc/issues/detail?id=4986. |
| 74 #if !defined(OS_WIN) |
71 { "720p", 1280, 720, | 75 { "720p", 1280, 720, |
72 test::kReferenceFileName720p, | 76 test::kReferenceFileName720p, |
73 WebRtcTestBase::kAudioVideoCallConstraints720p }, | 77 WebRtcTestBase::kAudioVideoCallConstraints720p }, |
| 78 #endif |
74 }; | 79 }; |
75 | 80 |
76 // Test the video quality of the WebRTC output. | 81 // Test the video quality of the WebRTC output. |
77 // | 82 // |
78 // Prerequisites: This test case must run on a machine with a chrome playing | 83 // Prerequisites: This test case must run on a machine with a chrome playing |
79 // the video from the reference files located in GetReferenceFilesDir(). | 84 // the video from the reference files located in GetReferenceFilesDir(). |
80 // The file kReferenceY4mFileName.kY4mFileExtension is played using a | 85 // The file kReferenceY4mFileName.kY4mFileExtension is played using a |
81 // FileVideoCaptureDevice and its sibling with kYuvFileExtension is used for | 86 // FileVideoCaptureDevice and its sibling with kYuvFileExtension is used for |
82 // comparison. | 87 // comparison. |
83 // | 88 // |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 330 |
326 // Poll slower here to avoid flooding the log with messages: capturing and | 331 // Poll slower here to avoid flooding the log with messages: capturing and |
327 // sending frames take quite a bit of time. | 332 // sending frames take quite a bit of time. |
328 int polling_interval_msec = 1000; | 333 int polling_interval_msec = 1000; |
329 | 334 |
330 EXPECT_TRUE(test::PollingWaitUntil( | 335 EXPECT_TRUE(test::PollingWaitUntil( |
331 "doneFrameCapturing()", "done-capturing", right_tab, | 336 "doneFrameCapturing()", "done-capturing", right_tab, |
332 polling_interval_msec)); | 337 polling_interval_msec)); |
333 | 338 |
334 HangUp(left_tab); | 339 HangUp(left_tab); |
335 CloseLastLocalStream(left_tab); | |
336 CloseLastLocalStream(right_tab); | |
337 | 340 |
338 WriteCapturedFramesToWorkingDir(right_tab); | 341 WriteCapturedFramesToWorkingDir(right_tab); |
339 | 342 |
340 // Shut everything down to avoid having the javascript race with the analysis | 343 // Shut everything down to avoid having the javascript race with the analysis |
341 // tools. For instance, dont have console log printouts interleave with the | 344 // tools. For instance, dont have console log printouts interleave with the |
342 // RESULT lines from the analysis tools (crbug.com/323200). | 345 // RESULT lines from the analysis tools (crbug.com/323200). |
343 chrome::CloseWebContents(browser(), left_tab, false); | 346 chrome::CloseWebContents(browser(), left_tab, false); |
344 chrome::CloseWebContents(browser(), right_tab, false); | 347 chrome::CloseWebContents(browser(), right_tab, false); |
345 | 348 |
346 ASSERT_TRUE(RunARGBtoI420Converter( | 349 ASSERT_TRUE(RunARGBtoI420Converter( |
347 test_config_.width, test_config_.height, | 350 test_config_.width, test_config_.height, |
348 GetWorkingDir().Append(kCapturedYuvFileName))); | 351 GetWorkingDir().Append(kCapturedYuvFileName))); |
349 ASSERT_TRUE(CompareVideosAndPrintResult( | 352 ASSERT_TRUE(CompareVideosAndPrintResult( |
350 test_config_.test_name, | 353 test_config_.test_name, |
351 test_config_.width, | 354 test_config_.width, |
352 test_config_.height, | 355 test_config_.height, |
353 GetWorkingDir().Append(kCapturedYuvFileName), | 356 GetWorkingDir().Append(kCapturedYuvFileName), |
354 test::GetReferenceFilesDir() | 357 test::GetReferenceFilesDir() |
355 .Append(test_config_.reference_video) | 358 .Append(test_config_.reference_video) |
356 .AddExtension(test::kYuvFileExtension), | 359 .AddExtension(test::kYuvFileExtension), |
357 GetWorkingDir().Append(kStatsFileName))); | 360 GetWorkingDir().Append(kStatsFileName))); |
358 } | 361 } |
OLD | NEW |