| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 179 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
| 180 | 180 |
| 181 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 181 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 182 } | 182 } |
| 183 | 183 |
| 184 // TODO(grunell): Add test for multiple dumps when re-use of | 184 // TODO(grunell): Add test for multiple dumps when re-use of |
| 185 // MediaStreamAudioProcessor in AudioCapturer has been removed. | 185 // MediaStreamAudioProcessor in AudioCapturer has been removed. |
| 186 | 186 |
| 187 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER) | 187 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER) |
| 188 // Renderer crashes under Android ASAN: https://crbug.com/408496. | 188 // Renderer crashes under Android ASAN: https://crbug.com/408496. |
| 189 #define MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled DISABLED_CallWithA
udioDebugRecordingsEnabledThenDisabled | 189 #define MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled \ |
| 190 DISABLED_CallWithAudioDebugRecordingsEnabledThenDisabled |
| 190 #else | 191 #else |
| 191 #define MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled CallWithAudioDebug
RecordingsEnabledThenDisabled | 192 #define MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled \ |
| 193 CallWithAudioDebugRecordingsEnabledThenDisabled |
| 192 #endif | 194 #endif |
| 193 | 195 |
| 194 // As above, but enable and disable recordings before starting a call. No files | 196 // As above, but enable and disable recordings before starting a call. No files |
| 195 // should be created. | 197 // should be created. |
| 196 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, | 198 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, |
| 197 MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled) { | 199 MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled) { |
| 198 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { | 200 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { |
| 199 LOG(INFO) << "Missing output devices: skipping test..."; | 201 LOG(INFO) << "Missing output devices: skipping test..."; |
| 200 return; | 202 return; |
| 201 } | 203 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 224 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); | 226 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); |
| 225 ExecuteJavascriptAndWaitForOk("hangup();"); | 227 ExecuteJavascriptAndWaitForOk("hangup();"); |
| 226 | 228 |
| 227 // Verify that no files exist and remove temp dir. | 229 // Verify that no files exist and remove temp dir. |
| 228 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 230 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
| 229 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 231 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
| 230 | 232 |
| 231 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 233 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 232 } | 234 } |
| 233 | 235 |
| 236 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER) |
| 234 // Renderer crashes under Android ASAN: https://crbug.com/408496. | 237 // Renderer crashes under Android ASAN: https://crbug.com/408496. |
| 238 #define MAYBE_TwoCallsWithAudioDebugRecordings \ |
| 239 DISABLED_TwoCallsWithAudioDebugRecordings |
| 240 #elif defined(OS_ANDROID) |
| 235 // Renderer crashes on Android M. https://crbug.com/535728. | 241 // Renderer crashes on Android M. https://crbug.com/535728. |
| 236 // TODO(grunell): Re-enable on all but Android. See conditions for the above two | 242 #define MAYBE_TwoCallsWithAudioDebugRecordings \ |
| 237 // tests. | 243 DISABLED_TwoCallsWithAudioDebugRecordings |
| 244 #else |
| 245 #define MAYBE_TwoCallsWithAudioDebugRecordings TwoCallsWithAudioDebugRecordings |
| 246 #endif |
| 247 |
| 248 // Same test as CallWithAudioDebugRecordings, but does two parallel calls. |
| 238 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, | 249 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, |
| 239 DISABLED_TwoCallsWithAudioDebugRecordings) { | 250 MAYBE_TwoCallsWithAudioDebugRecordings) { |
| 240 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { | 251 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { |
| 241 LOG(INFO) << "Missing output devices: skipping test..."; | 252 LOG(INFO) << "Missing output devices: skipping test..."; |
| 242 return; | 253 return; |
| 243 } | 254 } |
| 244 | 255 |
| 245 bool prev_io_allowed = base::ThreadRestrictions::SetIOAllowed(true); | 256 bool prev_io_allowed = base::ThreadRestrictions::SetIOAllowed(true); |
| 246 | 257 |
| 247 ASSERT_TRUE(embedded_test_server()->Start()); | 258 ASSERT_TRUE(embedded_test_server()->Start()); |
| 248 | 259 |
| 249 // We must navigate somewhere first so that the render process is created. | 260 // We must navigate somewhere first so that the render process is created. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 332 } |
| 322 | 333 |
| 323 // Verify that no other files exist and remove temp dir. | 334 // Verify that no other files exist and remove temp dir. |
| 324 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 335 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
| 325 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 336 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
| 326 | 337 |
| 327 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 338 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 328 } | 339 } |
| 329 | 340 |
| 330 } // namespace content | 341 } // namespace content |
| OLD | NEW |