| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 // This fakes the behavior of another open tab with webrtc-internals, and | 138 // This fakes the behavior of another open tab with webrtc-internals, and |
| 139 // enabling audio debug recordings in that tab. | 139 // enabling audio debug recordings in that tab. |
| 140 WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, NULL); | 140 WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, NULL); |
| 141 | 141 |
| 142 // Make a call. | 142 // Make a call. |
| 143 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 143 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
| 144 NavigateToURL(shell(), url); | 144 NavigateToURL(shell(), url); |
| 145 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); | 145 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); |
| 146 | 146 |
| 147 WebRTCInternals::GetInstance()->DisableAudioDebugRecordings(); |
| 148 |
| 147 // Verify that the expected AEC dump file exists and contains some data. | 149 // Verify that the expected AEC dump file exists and contains some data. |
| 148 base::ProcessId render_process_id = base::kNullProcessId; | 150 base::ProcessId render_process_id = base::kNullProcessId; |
| 149 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id)); | 151 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id)); |
| 150 base::FilePath file_path = | 152 base::FilePath file_path = |
| 151 GetExpectedAecDumpFileName(base_file_path, render_process_id); | 153 GetExpectedAecDumpFileName(base_file_path, render_process_id); |
| 152 EXPECT_TRUE(base::PathExists(file_path)); | 154 EXPECT_TRUE(base::PathExists(file_path)); |
| 153 int64_t file_size = 0; | 155 int64_t file_size = 0; |
| 154 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 156 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
| 155 EXPECT_GT(file_size, 0); | 157 EXPECT_GT(file_size, 0); |
| 156 base::DeleteFile(file_path, false); | 158 base::DeleteFile(file_path, false); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Make the calls. | 275 // Make the calls. |
| 274 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 276 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
| 275 NavigateToURL(shell(), url); | 277 NavigateToURL(shell(), url); |
| 276 NavigateToURL(shell2, url); | 278 NavigateToURL(shell2, url); |
| 277 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); | 279 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); |
| 278 std::string result; | 280 std::string result; |
| 279 EXPECT_TRUE(ExecuteScriptAndExtractString( | 281 EXPECT_TRUE(ExecuteScriptAndExtractString( |
| 280 shell2, "call({video: true, audio: true});", &result)); | 282 shell2, "call({video: true, audio: true});", &result)); |
| 281 ASSERT_STREQ("OK", result.c_str()); | 283 ASSERT_STREQ("OK", result.c_str()); |
| 282 | 284 |
| 285 WebRTCInternals::GetInstance()->DisableAudioDebugRecordings(); |
| 286 |
| 283 RenderProcessHost::iterator it = | 287 RenderProcessHost::iterator it = |
| 284 content::RenderProcessHost::AllHostsIterator(); | 288 content::RenderProcessHost::AllHostsIterator(); |
| 285 base::FilePath file_path; | 289 base::FilePath file_path; |
| 286 int64_t file_size = 0; | 290 int64_t file_size = 0; |
| 287 | 291 |
| 288 for (; !it.IsAtEnd(); it.Advance()) { | 292 for (; !it.IsAtEnd(); it.Advance()) { |
| 289 base::ProcessId render_process_id = | 293 base::ProcessId render_process_id = |
| 290 base::GetProcId(it.GetCurrentValue()->GetHandle()); | 294 base::GetProcId(it.GetCurrentValue()->GetHandle()); |
| 291 EXPECT_NE(base::kNullProcessId, render_process_id); | 295 EXPECT_NE(base::kNullProcessId, render_process_id); |
| 292 | 296 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 322 } | 326 } |
| 323 | 327 |
| 324 // Verify that no other files exist and remove temp dir. | 328 // Verify that no other files exist and remove temp dir. |
| 325 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); | 329 EXPECT_TRUE(base::IsDirectoryEmpty(temp_dir_path)); |
| 326 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); | 330 EXPECT_TRUE(base::DeleteFile(temp_dir_path, false)); |
| 327 | 331 |
| 328 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); | 332 base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); |
| 329 } | 333 } |
| 330 | 334 |
| 331 } // namespace content | 335 } // namespace content |
| OLD | NEW |