| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 93 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 94 // This test expects real device handling and requires a real webcam / audio | 94 // This test expects real device handling and requires a real webcam / audio |
| 95 // device; it will not work with fake devices. | 95 // device; it will not work with fake devices. |
| 96 EXPECT_FALSE(command_line->HasSwitch( | 96 EXPECT_FALSE(command_line->HasSwitch( |
| 97 switches::kUseFakeDeviceForMediaStream)); | 97 switches::kUseFakeDeviceForMediaStream)); |
| 98 EXPECT_FALSE(command_line->HasSwitch( | 98 EXPECT_FALSE(command_line->HasSwitch( |
| 99 switches::kUseFakeUIForMediaStream)); | 99 switches::kUseFakeUIForMediaStream)); |
| 100 | 100 |
| 101 bool enable_audio_track_processing = GetParam(); | 101 bool enable_audio_track_processing = GetParam(); |
| 102 if (!enable_audio_track_processing) | 102 if (enable_audio_track_processing) |
| 103 command_line->AppendSwitch(switches::kDisableAudioTrackProcessing); | 103 command_line->AppendSwitch(switches::kEnableAudioTrackProcessing); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void AddAudioFile(const std::string& input_file_relative_url, | 106 void AddAudioFile(const std::string& input_file_relative_url, |
| 107 content::WebContents* tab_contents) { | 107 content::WebContents* tab_contents) { |
| 108 EXPECT_EQ("ok-added", ExecuteJavascript( | 108 EXPECT_EQ("ok-added", ExecuteJavascript( |
| 109 "addAudioFile('" + input_file_relative_url + "')", tab_contents)); | 109 "addAudioFile('" + input_file_relative_url + "')", tab_contents)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void PlayAudioFile(content::WebContents* tab_contents) { | 112 void PlayAudioFile(content::WebContents* tab_contents) { |
| 113 EXPECT_EQ("ok-playing", ExecuteJavascript("playAudioFile()", tab_contents)); | 113 EXPECT_EQ("ok-playing", ExecuteJavascript("playAudioFile()", tab_contents)); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 test::GetReferenceFilesDir().Append(kReferenceFile); | 417 test::GetReferenceFilesDir().Append(kReferenceFile); |
| 418 ASSERT_TRUE(RunPesq(reference_file_in_test_dir, trimmed_recording, 16000, | 418 ASSERT_TRUE(RunPesq(reference_file_in_test_dir, trimmed_recording, 16000, |
| 419 &raw_mos, &mos_lqo)); | 419 &raw_mos, &mos_lqo)); |
| 420 | 420 |
| 421 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); | 421 perf_test::PrintResult("audio_pesq", "", "raw_mos", raw_mos, "score", true); |
| 422 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); | 422 perf_test::PrintResult("audio_pesq", "", "mos_lqo", mos_lqo, "score", true); |
| 423 | 423 |
| 424 EXPECT_TRUE(base::DeleteFile(recording, false)); | 424 EXPECT_TRUE(base::DeleteFile(recording, false)); |
| 425 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); | 425 EXPECT_TRUE(base::DeleteFile(trimmed_recording, false)); |
| 426 } | 426 } |
| OLD | NEW |