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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 file_size = 0; | 163 file_size = 0; |
164 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 164 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
165 EXPECT_GT(file_size, kWaveHeaderSizeBytes); | 165 EXPECT_GT(file_size, kWaveHeaderSizeBytes); |
166 base::DeleteFile(file_path, false); | 166 base::DeleteFile(file_path, false); |
167 | 167 |
168 // Verify that the expected output audio files exists and contains some data. | 168 // Verify that the expected output audio files exists and contains some data. |
169 // Two files are expected, one for each peer in the call. | 169 // Two files are expected, one for each peer in the call. |
170 for (int i = 0; i < 2; ++i) { | 170 for (int i = 0; i < 2; ++i) { |
171 file_path = GetExpectedOutputAudioFileName( | 171 file_path = GetExpectedOutputAudioFileName( |
172 base_file_path, kExpectedFirstOutputStreamId + i); | 172 base_file_path, kExpectedFirstOutputStreamId + i); |
173 // Flaky on Mac. http://crbug.com/700859. | |
174 #if !defined(OS_MACOSX) | |
175 EXPECT_TRUE(base::PathExists(file_path)); | 173 EXPECT_TRUE(base::PathExists(file_path)); |
176 file_size = 0; | 174 file_size = 0; |
177 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 175 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
178 EXPECT_GT(file_size, kWaveHeaderSizeBytes); | 176 EXPECT_GT(file_size, kWaveHeaderSizeBytes); |
179 #endif | |
180 base::DeleteFile(file_path, false); | 177 base::DeleteFile(file_path, false); |
181 } | 178 } |
182 | 179 |
183 // Remove temp dir. | 180 // Remove temp dir. |
184 // TODO(grunell): Re-enable or remove the following line as part of | 181 // TODO(grunell): Re-enable or remove the following line as part of |
185 // http://crbug.com/697845. If re-enabled, also add expectations on | 182 // http://crbug.com/697845. If re-enabled, also add expectations on |
186 // base::DeleteFile() success. | 183 // base::DeleteFile() success. |
187 // EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 184 // EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
188 base::DeleteFile(temp_dir_path, false); | 185 base::DeleteFile(temp_dir_path, false); |
189 | 186 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 326 } |
330 | 327 |
331 // Verify that no other files exist and remove temp dir. | 328 // Verify that no other files exist and remove temp dir. |
332 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 329 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
333 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 330 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
334 | 331 |
335 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 332 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
336 } | 333 } |
337 | 334 |
338 } // namespace content | 335 } // namespace content |
OLD | NEW |