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/file_util.h" | 8 #include "base/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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // devices. Tick 'show disabled devices'. | 82 // devices. Tick 'show disabled devices'. |
83 // 3. You should see a 'stero mix' device - this is what your speakers output. | 83 // 3. You should see a 'stero mix' device - this is what your speakers output. |
84 // Right click > Properties. | 84 // Right click > Properties. |
85 // 4. In the Listen tab for the mix device, check the 'listen to this device' | 85 // 4. In the Listen tab for the mix device, check the 'listen to this device' |
86 // checkbox. Ensure the mix device is the default recording device. | 86 // checkbox. Ensure the mix device is the default recording device. |
87 // 5. Launch chrome and try playing a video with sound. You should see | 87 // 5. Launch chrome and try playing a video with sound. You should see |
88 // in the volume meter for the mix device. Configure the mix device to have | 88 // in the volume meter for the mix device. Configure the mix device to have |
89 // 50 / 100 in level. Also go into the playback tab, right-click Speakers, | 89 // 50 / 100 in level. Also go into the playback tab, right-click Speakers, |
90 // and set that level to 50 / 100. Otherwise you will get distortion in | 90 // and set that level to 50 / 100. Otherwise you will get distortion in |
91 // the recording. | 91 // the recording. |
92 class WebRtcAudioQualityBrowserTest : public WebRtcTestBase { | 92 class WebRtcAudioQualityBrowserTest : public WebRtcTestBase, |
93 public testing::WithParamInterface<bool> { | |
93 public: | 94 public: |
95 WebRtcAudioQualityBrowserTest() { | |
96 if (GetParam()) { | |
phoglund_chromium
2014/03/12 17:27:18
bool enable_audio_track_processing = GetParam() to
no longer working on chromium
2014/03/12 18:06:07
Done.
| |
97 CommandLine::ForCurrentProcess()->AppendSwitch( | |
phoglund_chromium
2014/03/12 17:27:18
Do this in SetupCommandLine below instead and act
no longer working on chromium
2014/03/12 18:06:08
I guess you meant SetUpCommandLine(CommandLine* co
| |
98 switches::kEnableAudioTrackProcessing); | |
99 } | |
100 } | |
94 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 101 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
95 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); | 102 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
96 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 103 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
97 } | 104 } |
98 | 105 |
99 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 106 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
100 // This test expects real device handling and requires a real webcam / audio | 107 // This test expects real device handling and requires a real webcam / audio |
101 // device; it will not work with fake devices. | 108 // device; it will not work with fake devices. |
102 EXPECT_FALSE(command_line->HasSwitch( | 109 EXPECT_FALSE(command_line->HasSwitch( |
103 switches::kUseFakeDeviceForMediaStream)); | 110 switches::kUseFakeDeviceForMediaStream)); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 // There are two tab-separated numbers on the format x.xxx, e.g. 5 chars each. | 361 // There are two tab-separated numbers on the format x.xxx, e.g. 5 chars each. |
355 std::size_t first_number_pos = anchor_pos + result_anchor.length(); | 362 std::size_t first_number_pos = anchor_pos + result_anchor.length(); |
356 *raw_mos = result.substr(first_number_pos, 5); | 363 *raw_mos = result.substr(first_number_pos, 5); |
357 EXPECT_TRUE(CanParseAsFloat(*raw_mos)) << "Failed to parse raw MOS number."; | 364 EXPECT_TRUE(CanParseAsFloat(*raw_mos)) << "Failed to parse raw MOS number."; |
358 *mos_lqo = result.substr(first_number_pos + 5 + 1, 5); | 365 *mos_lqo = result.substr(first_number_pos + 5 + 1, 5); |
359 EXPECT_TRUE(CanParseAsFloat(*mos_lqo)) << "Failed to parse MOS LQO number."; | 366 EXPECT_TRUE(CanParseAsFloat(*mos_lqo)) << "Failed to parse MOS LQO number."; |
360 | 367 |
361 return true; | 368 return true; |
362 } | 369 } |
363 | 370 |
371 static const bool kRunTestsWithFlag[] = { false, true }; | |
372 INSTANTIATE_TEST_CASE_P(WebRtcAudioQualityBrowserTests, | |
373 WebRtcAudioQualityBrowserTest, | |
374 testing::ValuesIn(kRunTestsWithFlag)); | |
375 | |
364 // Should be enabled for Linux, but is flaky. http://crbug.com/340197. | 376 // Should be enabled for Linux, but is flaky. http://crbug.com/340197. |
365 #if defined(OS_WIN) | 377 #if defined(OS_WIN) |
366 // Only implemented on Linux and Windows for now. | 378 // Only implemented on Linux and Windows for now. |
367 #define MAYBE_MANUAL_TestAudioQuality MANUAL_TestAudioQuality | 379 #define MAYBE_MANUAL_TestAudioQuality MANUAL_TestAudioQuality |
368 #else | 380 #else |
369 #define MAYBE_MANUAL_TestAudioQuality DISABLED_MANUAL_TestAudioQuality | 381 #define MAYBE_MANUAL_TestAudioQuality DISABLED_MANUAL_TestAudioQuality |
370 #endif | 382 #endif |
371 | 383 |
372 IN_PROC_BROWSER_TEST_F(WebRtcAudioQualityBrowserTest, | 384 IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest, |
373 MAYBE_MANUAL_TestAudioQuality) { | 385 MAYBE_MANUAL_TestAudioQuality) { |
374 #if defined(OS_WIN) | 386 #if defined(OS_WIN) |
375 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 387 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
376 // It would take work to implement this on XP; not prioritized right now. | 388 // It would take work to implement this on XP; not prioritized right now. |
377 LOG(ERROR) << "This test is not implemented for Windows XP."; | 389 LOG(ERROR) << "This test is not implemented for Windows XP."; |
378 return; | 390 return; |
379 } | 391 } |
380 #endif | 392 #endif |
381 ASSERT_TRUE(HasAllRequiredResources()); | 393 ASSERT_TRUE(HasAllRequiredResources()); |
382 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 394 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 &raw_mos, &mos_lqo)); | 453 &raw_mos, &mos_lqo)); |
442 | 454 |
443 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); | 455 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); |
444 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); | 456 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); |
445 | 457 |
446 EXPECT_TRUE(base::DeleteFile(recording, false)); | 458 EXPECT_TRUE(base::DeleteFile(recording, false)); |
447 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); | 459 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); |
448 | 460 |
449 ASSERT_TRUE(peerconnection_server_.Stop()); | 461 ASSERT_TRUE(peerconnection_server_.Stop()); |
450 } | 462 } |
OLD | NEW |