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

Side by Side Diff: trunk/src/media/cast/audio_sender/audio_encoder_unittest.cc

Issue 25546003: Revert 226264 "Be able to build cast_unittest and related target..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "media/cast/audio_sender/audio_encoder.h" 7 #include "media/cast/audio_sender/audio_encoder.h"
8 #include "media/cast/cast_config.h" 8 #include "media/cast/cast_config.h"
9 #include "media/cast/cast_thread.h" 9 #include "media/cast/cast_thread.h"
10 #include "media/cast/test/fake_task_runner.h" 10 #include "media/cast/test/fake_task_runner.h"
(...skipping 27 matching lines...) Expand all
38 audio_config.codec = kOpus; 38 audio_config.codec = kOpus;
39 audio_config.use_external_encoder = false; 39 audio_config.use_external_encoder = false;
40 audio_config.frequency = 48000; 40 audio_config.frequency = 48000;
41 audio_config.channels = 2; 41 audio_config.channels = 2;
42 audio_config.bitrate = 64000; 42 audio_config.bitrate = 64000;
43 audio_config.rtp_payload_type = 127; 43 audio_config.rtp_payload_type = 127;
44 44
45 audio_encoder_ = new AudioEncoder(cast_thread_, audio_config); 45 audio_encoder_ = new AudioEncoder(cast_thread_, audio_config);
46 } 46 }
47 47
48 virtual ~AudioEncoderTest() {} 48 ~AudioEncoderTest() {}
49 49
50 base::SimpleTestTickClock testing_clock_; 50 base::SimpleTestTickClock testing_clock_;
51 scoped_refptr<test::FakeTaskRunner> task_runner_; 51 scoped_refptr<test::FakeTaskRunner> task_runner_;
52 scoped_refptr<AudioEncoder> audio_encoder_; 52 scoped_refptr<AudioEncoder> audio_encoder_;
53 scoped_refptr<CastThread> cast_thread_; 53 scoped_refptr<CastThread> cast_thread_;
54 }; 54 };
55 55
56 TEST_F(AudioEncoderTest, Encode20ms) { 56 TEST_F(AudioEncoderTest, Encode20ms) {
57 PcmAudioFrame* audio_frame = new PcmAudioFrame(); 57 PcmAudioFrame* audio_frame = new PcmAudioFrame();
58 audio_frame->channels = 2; 58 audio_frame->channels = 2;
59 audio_frame->frequency = 48000; 59 audio_frame->frequency = 48000;
60 audio_frame->samples.insert(audio_frame->samples.begin(), 480 * 2 * 2, 123); 60 audio_frame->samples.insert(audio_frame->samples.begin(), 480 * 2 * 2, 123);
61 61
62 base::TimeTicks recorded_time; 62 base::TimeTicks recorded_time;
63 audio_encoder_->InsertRawAudioFrame(audio_frame, recorded_time, 63 audio_encoder_->InsertRawAudioFrame(audio_frame, recorded_time,
64 base::Bind(&FrameEncoded), 64 base::Bind(&FrameEncoded),
65 base::Bind(&RelaseFrame, audio_frame)); 65 base::Bind(&RelaseFrame, audio_frame));
66 task_runner_->RunTasks(); 66 task_runner_->RunTasks();
67 } 67 }
68 68
69 } // namespace cast 69 } // namespace cast
70 } // namespace media 70 } // namespace media
OLDNEW
« no previous file with comments | « trunk/src/media/cast/audio_sender/audio_encoder.cc ('k') | trunk/src/media/cast/audio_sender/audio_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698