Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: content/browser/media/webrtc_browsertest.cc

Issue 334743006: Support multiple files for AEC dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
8 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "content/browser/media/webrtc_internals.h" 11 #include "content/browser/media/webrtc_internals.h"
11 #include "content/browser/web_contents/web_contents_impl.h" 12 #include "content/browser/web_contents/web_contents_impl.h"
12 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
13 #include "content/public/test/browser_test_utils.h" 14 #include "content/public/test/browser_test_utils.h"
14 #include "content/public/test/content_browser_test_utils.h" 15 #include "content/public/test/content_browser_test_utils.h"
15 #include "content/public/test/test_utils.h" 16 #include "content/public/test/test_utils.h"
16 #include "content/shell/browser/shell.h" 17 #include "content/shell/browser/shell.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 404
404 // This fakes the behavior of another open tab with webrtc-internals, and 405 // This fakes the behavior of another open tab with webrtc-internals, and
405 // enabling AEC dump in that tab. 406 // enabling AEC dump in that tab.
406 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL); 407 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
407 408
408 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 409 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
409 NavigateToURL(shell(), url); 410 NavigateToURL(shell(), url);
410 DisableOpusIfOnAndroid(); 411 DisableOpusIfOnAndroid();
411 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); 412 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
412 413
414 // Get the ID for the render process host. There should only be one.
415 RenderProcessHost::iterator it(
416 content::RenderProcessHost::AllHostsIterator());
417 int render_process_host_id = it.GetCurrentValue()->GetID();
418 EXPECT_GE(render_process_host_id, 0);
419
420 // Add file extensions that we expect to be added.
421 static const int kExpectedConsumerId = 0;
422 dump_file = dump_file.AddExtension(base::IntToString(render_process_host_id))
423 .AddExtension(base::IntToString(kExpectedConsumerId));
424
413 EXPECT_TRUE(base::PathExists(dump_file)); 425 EXPECT_TRUE(base::PathExists(dump_file));
414 int64 file_size = 0; 426 int64 file_size = 0;
415 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 427 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
416 EXPECT_GT(file_size, 0); 428 EXPECT_GT(file_size, 0);
417 429
418 base::DeleteFile(dump_file, false); 430 base::DeleteFile(dump_file, false);
419 } 431 }
420 432
433 // TODO(grunell): Add test for multiple dumps when re-use of
434 // MediaStreamAudioProcessor in AudioCapturer has been removed.
435
421 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 436 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
422 // Timing out on ARM linux bot: http://crbug.com/238490 437 // Timing out on ARM linux bot: http://crbug.com/238490
423 #define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabled ThenDisabled 438 #define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabled ThenDisabled
424 #else 439 #else
425 #define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisab led 440 #define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisab led
426 #endif 441 #endif
427 442
428 // As above, but enable and disable dump before starting a call. The file should 443 // As above, but enable and disable dump before starting a call. The file should
429 // be created, but should be empty. 444 // be created, but should be empty.
430 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, 445 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
(...skipping 18 matching lines...) Expand all
449 464
450 EXPECT_TRUE(base::PathExists(dump_file)); 465 EXPECT_TRUE(base::PathExists(dump_file));
451 int64 file_size = 0; 466 int64 file_size = 0;
452 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 467 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
453 EXPECT_EQ(0, file_size); 468 EXPECT_EQ(0, file_size);
454 469
455 base::DeleteFile(dump_file, false); 470 base::DeleteFile(dump_file, false);
456 } 471 }
457 472
458 } // namespace content 473 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698