| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/process/process_handle.h" | 7 #include "base/process/process_handle.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Verify that the expected AEC dump file exists and contains some data. | 147 // Verify that the expected AEC dump file exists and contains some data. |
| 148 base::ProcessId render_process_id = base::kNullProcessId; | 148 base::ProcessId render_process_id = base::kNullProcessId; |
| 149 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id)); | 149 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id)); |
| 150 base::FilePath file_path = | 150 base::FilePath file_path = |
| 151 GetExpectedAecDumpFileName(base_file_path, render_process_id); | 151 GetExpectedAecDumpFileName(base_file_path, render_process_id); |
| 152 EXPECT_TRUE(base::PathExists(file_path)); | 152 EXPECT_TRUE(base::PathExists(file_path)); |
| 153 int64_t file_size = 0; | 153 int64_t file_size = 0; |
| 154 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 154 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
| 155 EXPECT_GT(file_size, 0); | 155 EXPECT_GT(file_size, 0); |
| 156 EXPECT_TRUE(base::DeleteFile(file_path, false)); | 156 base::DeleteFile(file_path, false); |
| 157 | 157 |
| 158 // Verify that the expected input audio file exists and contains some data. | 158 // Verify that the expected input audio file exists and contains some data. |
| 159 file_path = GetExpectedInputAudioFileName(base_file_path, render_process_id); | 159 file_path = GetExpectedInputAudioFileName(base_file_path, render_process_id); |
| 160 EXPECT_TRUE(base::PathExists(file_path)); | 160 EXPECT_TRUE(base::PathExists(file_path)); |
| 161 file_size = 0; | 161 file_size = 0; |
| 162 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 162 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
| 163 EXPECT_GT(file_size, kWaveHeaderSizeBytes); | 163 EXPECT_GT(file_size, kWaveHeaderSizeBytes); |
| 164 EXPECT_TRUE(base::DeleteFile(file_path, false)); | 164 base::DeleteFile(file_path, false); |
| 165 | 165 |
| 166 // Verify that the expected output audio files exists and contains some data. | 166 // Verify that the expected output audio files exists and contains some data. |
| 167 // Two files are expected, one for each peer in the call. | 167 // Two files are expected, one for each peer in the call. |
| 168 for (int i = 0; i < 2; ++i) { | 168 for (int i = 0; i < 2; ++i) { |
| 169 file_path = GetExpectedOutputAudioFileName( | 169 file_path = GetExpectedOutputAudioFileName( |
| 170 base_file_path, kExpectedFirstOutputStreamId + i); | 170 base_file_path, kExpectedFirstOutputStreamId + i); |
| 171 EXPECT_TRUE(base::PathExists(file_path)); | 171 EXPECT_TRUE(base::PathExists(file_path)); |
| 172 file_size = 0; | 172 file_size = 0; |
| 173 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 173 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
| 174 EXPECT_GT(file_size, kWaveHeaderSizeBytes); | 174 EXPECT_GT(file_size, kWaveHeaderSizeBytes); |
| 175 EXPECT_TRUE(base::DeleteFile(file_path, false)); | 175 base::DeleteFile(file_path, false); |
| 176 } | 176 } |
| 177 | 177 |
| 178 // Verify that no other files exist and remove temp dir. | 178 // Verify that no other files exist and remove temp dir. |
| 179 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 179 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
| 180 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 180 base::DeleteFile(temp_dir_path, false); |
| 181 | 181 |
| 182 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 182 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 183 } | 183 } |
| 184 | 184 |
| 185 // TODO(grunell): Add test for multiple dumps when re-use of | 185 // TODO(grunell): Add test for multiple dumps when re-use of |
| 186 // MediaStreamAudioProcessor in AudioCapturer has been removed. | 186 // MediaStreamAudioProcessor in AudioCapturer has been removed. |
| 187 | 187 |
| 188 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 188 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
| 189 // Timing out on ARM linux bot: http://crbug.com/238490 | 189 // Timing out on ARM linux bot: http://crbug.com/238490 |
| 190 // TODO(grunell): Re-enable for ARM Linux. Bug is closed as fixed. | 190 // TODO(grunell): Re-enable for ARM Linux. Bug is closed as fixed. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 319 } |
| 320 | 320 |
| 321 // Verify that no other files exist and remove temp dir. | 321 // Verify that no other files exist and remove temp dir. |
| 322 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 322 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
| 323 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 323 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
| 324 | 324 |
| 325 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 325 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace content | 328 } // namespace content |
| OLD | NEW |