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) | |
75 { "720p", 1280, 720, | 71 { "720p", 1280, 720, |
76 test::kReferenceFileName720p, | 72 test::kReferenceFileName720p, |
77 WebRtcTestBase::kAudioVideoCallConstraints720p }, | 73 WebRtcTestBase::kAudioVideoCallConstraints720p }, |
78 #endif | |
79 }; | 74 }; |
80 | 75 |
81 // Test the video quality of the WebRTC output. | 76 // Test the video quality of the WebRTC output. |
82 // | 77 // |
83 // Prerequisites: This test case must run on a machine with a chrome playing | 78 // Prerequisites: This test case must run on a machine with a chrome playing |
84 // the video from the reference files located in GetReferenceFilesDir(). | 79 // the video from the reference files located in GetReferenceFilesDir(). |
85 // The file kReferenceY4mFileName.kY4mFileExtension is played using a | 80 // The file kReferenceY4mFileName.kY4mFileExtension is played using a |
86 // FileVideoCaptureDevice and its sibling with kYuvFileExtension is used for | 81 // FileVideoCaptureDevice and its sibling with kYuvFileExtension is used for |
87 // comparison. | 82 // comparison. |
88 // | 83 // |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 325 |
331 // Poll slower here to avoid flooding the log with messages: capturing and | 326 // Poll slower here to avoid flooding the log with messages: capturing and |
332 // sending frames take quite a bit of time. | 327 // sending frames take quite a bit of time. |
333 int polling_interval_msec = 1000; | 328 int polling_interval_msec = 1000; |
334 | 329 |
335 EXPECT_TRUE(test::PollingWaitUntil( | 330 EXPECT_TRUE(test::PollingWaitUntil( |
336 "doneFrameCapturing()", "done-capturing", right_tab, | 331 "doneFrameCapturing()", "done-capturing", right_tab, |
337 polling_interval_msec)); | 332 polling_interval_msec)); |
338 | 333 |
339 HangUp(left_tab); | 334 HangUp(left_tab); |
| 335 CloseLastLocalStream(left_tab); |
| 336 CloseLastLocalStream(right_tab); |
340 | 337 |
341 WriteCapturedFramesToWorkingDir(right_tab); | 338 WriteCapturedFramesToWorkingDir(right_tab); |
342 | 339 |
343 // Shut everything down to avoid having the javascript race with the analysis | 340 // Shut everything down to avoid having the javascript race with the analysis |
344 // tools. For instance, dont have console log printouts interleave with the | 341 // tools. For instance, dont have console log printouts interleave with the |
345 // RESULT lines from the analysis tools (crbug.com/323200). | 342 // RESULT lines from the analysis tools (crbug.com/323200). |
346 chrome::CloseWebContents(browser(), left_tab, false); | 343 chrome::CloseWebContents(browser(), left_tab, false); |
347 chrome::CloseWebContents(browser(), right_tab, false); | 344 chrome::CloseWebContents(browser(), right_tab, false); |
348 | 345 |
349 ASSERT_TRUE(RunARGBtoI420Converter( | 346 ASSERT_TRUE(RunARGBtoI420Converter( |
350 test_config_.width, test_config_.height, | 347 test_config_.width, test_config_.height, |
351 GetWorkingDir().Append(kCapturedYuvFileName))); | 348 GetWorkingDir().Append(kCapturedYuvFileName))); |
352 ASSERT_TRUE(CompareVideosAndPrintResult( | 349 ASSERT_TRUE(CompareVideosAndPrintResult( |
353 test_config_.test_name, | 350 test_config_.test_name, |
354 test_config_.width, | 351 test_config_.width, |
355 test_config_.height, | 352 test_config_.height, |
356 GetWorkingDir().Append(kCapturedYuvFileName), | 353 GetWorkingDir().Append(kCapturedYuvFileName), |
357 test::GetReferenceFilesDir() | 354 test::GetReferenceFilesDir() |
358 .Append(test_config_.reference_video) | 355 .Append(test_config_.reference_video) |
359 .AddExtension(test::kYuvFileExtension), | 356 .AddExtension(test::kYuvFileExtension), |
360 GetWorkingDir().Append(kStatsFileName))); | 357 GetWorkingDir().Append(kStatsFileName))); |
361 } | 358 } |
OLD | NEW |