| 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 "base/process/process_handle.h" | 5 #include "base/process/process_handle.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "content/browser/media/webrtc_internals.h" | 8 #include "content/browser/media/webrtc_internals.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Javascript is bypassed since it would trigger a file picker dialog. Instead, | 91 // Javascript is bypassed since it would trigger a file picker dialog. Instead, |
| 92 // the dialog callback FileSelected() is invoked directly. In fact, there's | 92 // the dialog callback FileSelected() is invoked directly. In fact, there's |
| 93 // never a webrtc-internals page opened at all since that's not needed. | 93 // never a webrtc-internals page opened at all since that's not needed. |
| 94 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, | 94 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, |
| 95 MAYBE_CallWithAudioDebugRecordings) { | 95 MAYBE_CallWithAudioDebugRecordings) { |
| 96 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { | 96 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { |
| 97 LOG(INFO) << "Missing output devices: skipping test..."; | 97 LOG(INFO) << "Missing output devices: skipping test..."; |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 | 100 |
| 101 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 101 ASSERT_TRUE(embedded_test_server()->Start()); |
| 102 | 102 |
| 103 // We must navigate somewhere first so that the render process is created. | 103 // We must navigate somewhere first so that the render process is created. |
| 104 NavigateToURL(shell(), GURL("")); | 104 NavigateToURL(shell(), GURL("")); |
| 105 | 105 |
| 106 base::FilePath base_file; | 106 base::FilePath base_file; |
| 107 ASSERT_TRUE(CreateTemporaryFile(&base_file)); | 107 ASSERT_TRUE(CreateTemporaryFile(&base_file)); |
| 108 base::DeleteFile(base_file, false); | 108 base::DeleteFile(base_file, false); |
| 109 | 109 |
| 110 // This fakes the behavior of another open tab with webrtc-internals, and | 110 // This fakes the behavior of another open tab with webrtc-internals, and |
| 111 // enabling AEC dump in that tab. | 111 // enabling AEC dump in that tab. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // As above, but enable and disable dump before starting a call. The file should | 158 // As above, but enable and disable dump before starting a call. The file should |
| 159 // be created, but should be empty. | 159 // be created, but should be empty. |
| 160 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, | 160 IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, |
| 161 MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled) { | 161 MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled) { |
| 162 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { | 162 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { |
| 163 LOG(INFO) << "Missing output devices: skipping test..."; | 163 LOG(INFO) << "Missing output devices: skipping test..."; |
| 164 return; | 164 return; |
| 165 } | 165 } |
| 166 | 166 |
| 167 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 167 ASSERT_TRUE(embedded_test_server()->Start()); |
| 168 | 168 |
| 169 // We must navigate somewhere first so that the render process is created. | 169 // We must navigate somewhere first so that the render process is created. |
| 170 NavigateToURL(shell(), GURL("")); | 170 NavigateToURL(shell(), GURL("")); |
| 171 | 171 |
| 172 base::FilePath base_file; | 172 base::FilePath base_file; |
| 173 ASSERT_TRUE(CreateTemporaryFile(&base_file)); | 173 ASSERT_TRUE(CreateTemporaryFile(&base_file)); |
| 174 base::DeleteFile(base_file, false); | 174 base::DeleteFile(base_file, false); |
| 175 | 175 |
| 176 // This fakes the behavior of another open tab with webrtc-internals, and | 176 // This fakes the behavior of another open tab with webrtc-internals, and |
| 177 // enabling AEC dump in that tab, then disabling it. | 177 // enabling AEC dump in that tab, then disabling it. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 204 DISABLED_TwoCallsWithAudioDebugRecordings) { | 204 DISABLED_TwoCallsWithAudioDebugRecordings) { |
| 205 if (OnWinXp()) { | 205 if (OnWinXp()) { |
| 206 LOG(INFO) << "Disabled on Win XP: skipping test..."; | 206 LOG(INFO) << "Disabled on Win XP: skipping test..."; |
| 207 return; | 207 return; |
| 208 } | 208 } |
| 209 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { | 209 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { |
| 210 LOG(INFO) << "Missing output devices: skipping test..."; | 210 LOG(INFO) << "Missing output devices: skipping test..."; |
| 211 return; | 211 return; |
| 212 } | 212 } |
| 213 | 213 |
| 214 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 214 ASSERT_TRUE(embedded_test_server()->Start()); |
| 215 | 215 |
| 216 // We must navigate somewhere first so that the render process is created. | 216 // We must navigate somewhere first so that the render process is created. |
| 217 NavigateToURL(shell(), GURL("")); | 217 NavigateToURL(shell(), GURL("")); |
| 218 | 218 |
| 219 // Create a second window. | 219 // Create a second window. |
| 220 Shell* shell2 = CreateBrowser(); | 220 Shell* shell2 = CreateBrowser(); |
| 221 NavigateToURL(shell2, GURL("")); | 221 NavigateToURL(shell2, GURL("")); |
| 222 | 222 |
| 223 base::FilePath base_file; | 223 base::FilePath base_file; |
| 224 ASSERT_TRUE(CreateTemporaryFile(&base_file)); | 224 ASSERT_TRUE(CreateTemporaryFile(&base_file)); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 EXPECT_TRUE(base::PathExists(input_audio_file)); | 268 EXPECT_TRUE(base::PathExists(input_audio_file)); |
| 269 file_size = 0; | 269 file_size = 0; |
| 270 EXPECT_TRUE(base::GetFileSize(input_audio_file, &file_size)); | 270 EXPECT_TRUE(base::GetFileSize(input_audio_file, &file_size)); |
| 271 EXPECT_GT(file_size, 0); | 271 EXPECT_GT(file_size, 0); |
| 272 | 272 |
| 273 base::DeleteFile(input_audio_file, false); | 273 base::DeleteFile(input_audio_file, false); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace content | 277 } // namespace content |
| OLD | NEW |