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 <ctime> | 5 #include <ctime> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // There are two tab-separated numbers on the format x.xxx, e.g. 5 chars each. | 332 // There are two tab-separated numbers on the format x.xxx, e.g. 5 chars each. |
333 std::size_t first_number_pos = anchor_pos + result_anchor.length(); | 333 std::size_t first_number_pos = anchor_pos + result_anchor.length(); |
334 *raw_mos = result.substr(first_number_pos, 5); | 334 *raw_mos = result.substr(first_number_pos, 5); |
335 EXPECT_TRUE(CanParseAsFloat(*raw_mos)) << "Failed to parse raw MOS number."; | 335 EXPECT_TRUE(CanParseAsFloat(*raw_mos)) << "Failed to parse raw MOS number."; |
336 *mos_lqo = result.substr(first_number_pos + 5 + 1, 5); | 336 *mos_lqo = result.substr(first_number_pos + 5 + 1, 5); |
337 EXPECT_TRUE(CanParseAsFloat(*mos_lqo)) << "Failed to parse MOS LQO number."; | 337 EXPECT_TRUE(CanParseAsFloat(*mos_lqo)) << "Failed to parse MOS LQO number."; |
338 | 338 |
339 return true; | 339 return true; |
340 } | 340 } |
341 | 341 |
342 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX) | 342 #if defined(OS_LINUX) || defined(OS_WIN) |
| 343 // Only implemented on Linux and Windows for now. |
343 #define MAYBE_MANUAL_TestAudioQuality MANUAL_TestAudioQuality | 344 #define MAYBE_MANUAL_TestAudioQuality MANUAL_TestAudioQuality |
344 #else | 345 #else |
345 // Not implemented on Android, ChromeOS etc. | |
346 #define MAYBE_MANUAL_TestAudioQuality DISABLED_MANUAL_TestAudioQuality | 346 #define MAYBE_MANUAL_TestAudioQuality DISABLED_MANUAL_TestAudioQuality |
347 #endif | 347 #endif |
348 | 348 |
349 IN_PROC_BROWSER_TEST_F(WebRtcAudioQualityBrowserTest, | 349 IN_PROC_BROWSER_TEST_F(WebRtcAudioQualityBrowserTest, |
350 MAYBE_MANUAL_TestAudioQuality) { | 350 MAYBE_MANUAL_TestAudioQuality) { |
351 if (OnWinXp()) { | 351 if (OnWinXp()) { |
352 LOG(ERROR) << "This test is not implemented for Windows XP."; | 352 LOG(ERROR) << "This test is not implemented for Windows XP."; |
353 return; | 353 return; |
354 } | 354 } |
355 if (OnWin8()) { | 355 if (OnWin8()) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 test::GetReferenceFilesDir().Append(kReferenceFile); | 416 test::GetReferenceFilesDir().Append(kReferenceFile); |
417 ASSERT_TRUE(RunPesq(reference_file_in_test_dir, trimmed_recording, 16000, | 417 ASSERT_TRUE(RunPesq(reference_file_in_test_dir, trimmed_recording, 16000, |
418 &raw_mos, &mos_lqo)); | 418 &raw_mos, &mos_lqo)); |
419 | 419 |
420 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); | 420 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); |
421 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); | 421 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); |
422 | 422 |
423 EXPECT_TRUE(base::DeleteFile(recording, false)); | 423 EXPECT_TRUE(base::DeleteFile(recording, false)); |
424 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); | 424 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); |
425 } | 425 } |
OLD | NEW |