| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/media/webrtc/webrtc_rtp_dump_writer.h" | 5 #include "chrome/browser/media/webrtc/webrtc_rtp_dump_writer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 class WebRtcRtpDumpWriterTest : public testing::Test { | 52 class WebRtcRtpDumpWriterTest : public testing::Test { |
| 53 public: | 53 public: |
| 54 WebRtcRtpDumpWriterTest() | 54 WebRtcRtpDumpWriterTest() |
| 55 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP | | 55 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP | |
| 56 content::TestBrowserThreadBundle::REAL_FILE_THREAD), | 56 content::TestBrowserThreadBundle::REAL_FILE_THREAD), |
| 57 temp_dir_(new base::ScopedTempDir()) {} | 57 temp_dir_(new base::ScopedTempDir()) {} |
| 58 | 58 |
| 59 virtual void SetUp() { | 59 virtual void SetUp() { |
| 60 ASSERT_TRUE(temp_dir_->CreateUniqueTempDir()); | 60 ASSERT_TRUE(temp_dir_->CreateUniqueTempDir()); |
| 61 | 61 |
| 62 incoming_dump_path_ = temp_dir_->path().AppendASCII("rtpdump_recv"); | 62 incoming_dump_path_ = temp_dir_->GetPath().AppendASCII("rtpdump_recv"); |
| 63 outgoing_dump_path_ = temp_dir_->path().AppendASCII("rtpdump_send"); | 63 outgoing_dump_path_ = temp_dir_->GetPath().AppendASCII("rtpdump_send"); |
| 64 writer_.reset(new WebRtcRtpDumpWriter( | 64 writer_.reset(new WebRtcRtpDumpWriter( |
| 65 incoming_dump_path_, | 65 incoming_dump_path_, |
| 66 outgoing_dump_path_, | 66 outgoing_dump_path_, |
| 67 4 * 1024 * 1024, | 67 4 * 1024 * 1024, |
| 68 base::Bind(&WebRtcRtpDumpWriterTest::OnMaxSizeReached, | 68 base::Bind(&WebRtcRtpDumpWriterTest::OnMaxSizeReached, |
| 69 base::Unretained(this)))); | 69 base::Unretained(this)))); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Verifies that the dump contains records of |rtp_packet| repeated | 72 // Verifies that the dump contains records of |rtp_packet| repeated |
| 73 // |packet_count| times. | 73 // |packet_count| times. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 base::Unretained(this))); | 360 base::Unretained(this))); |
| 361 | 361 |
| 362 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 362 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
| 363 base::RunLoop().RunUntilIdle(); | 363 base::RunLoop().RunUntilIdle(); |
| 364 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 364 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
| 365 base::RunLoop().RunUntilIdle(); | 365 base::RunLoop().RunUntilIdle(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 VerifyDumps(2, 1); | 368 VerifyDumps(2, 1); |
| 369 } | 369 } |
| OLD | NEW |