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

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: Code review (sky). 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.
415 int render_process_host_id = -1;
416 for (RenderProcessHost::iterator i(
417 content::RenderProcessHost::AllHostsIterator());
418 !i.IsAtEnd(); i.Advance()) {
419 render_process_host_id = i.GetCurrentValue()->GetID();
420 break;
Tom Sepez 2014/06/16 17:33:18 I'm confused by this loop which seems to only exec
Henrik Grunell 2014/06/17 20:21:40 Right, the loop is not needed. (Copy paste error.)
421 }
422 EXPECT_GE(render_process_host_id, 0);
423
424 // Add file extensions that we expect to be added.
425 static const int kExpectedConsumerId = 0;
426 dump_file = dump_file.AddExtension(base::IntToString(render_process_host_id))
427 .AddExtension(base::IntToString(kExpectedConsumerId));
428
413 EXPECT_TRUE(base::PathExists(dump_file)); 429 EXPECT_TRUE(base::PathExists(dump_file));
414 int64 file_size = 0; 430 int64 file_size = 0;
415 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 431 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
416 EXPECT_GT(file_size, 0); 432 EXPECT_GT(file_size, 0);
417 433
418 base::DeleteFile(dump_file, false); 434 base::DeleteFile(dump_file, false);
419 } 435 }
420 436
421 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 437 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
422 // Timing out on ARM linux bot: http://crbug.com/238490 438 // Timing out on ARM linux bot: http://crbug.com/238490
(...skipping 26 matching lines...) Expand all
449 465
450 EXPECT_TRUE(base::PathExists(dump_file)); 466 EXPECT_TRUE(base::PathExists(dump_file));
451 int64 file_size = 0; 467 int64 file_size = 0;
452 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 468 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
453 EXPECT_EQ(0, file_size); 469 EXPECT_EQ(0, file_size);
454 470
455 base::DeleteFile(dump_file, false); 471 base::DeleteFile(dump_file, false);
456 } 472 }
457 473
458 } // namespace content 474 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.h » ('j') | content/common/media/aec_dump_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698