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

Side by Side Diff: remoting/client/audio_player_unittest.cc

Issue 13642007: Rewrite scoped_array<T> to scoped_ptr<T[]> in remoting/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually rewrite Win files. Created 7 years, 8 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
« no previous file with comments | « remoting/base/util_unittest.cc ('k') | remoting/codec/audio_encoder_opus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "remoting/client/audio_player.h" 5 #include "remoting/client/audio_player.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 int GetNumQueuedPackets() { 80 int GetNumQueuedPackets() {
81 return static_cast<int>(audio_->queued_packets_.size()); 81 return static_cast<int>(audio_->queued_packets_.size());
82 } 82 }
83 83
84 int GetBytesConsumed() { 84 int GetBytesConsumed() {
85 return static_cast<int>(audio_->bytes_consumed_); 85 return static_cast<int>(audio_->bytes_consumed_);
86 } 86 }
87 87
88 scoped_ptr<AudioPlayer> audio_; 88 scoped_ptr<AudioPlayer> audio_;
89 scoped_array<char> buffer_; 89 scoped_ptr<char[]> buffer_;
90 }; 90 };
91 91
92 scoped_ptr<AudioPacket> CreatePacketWithSamplingRate( 92 scoped_ptr<AudioPacket> CreatePacketWithSamplingRate(
93 AudioPacket::SamplingRate rate, int samples) { 93 AudioPacket::SamplingRate rate, int samples) {
94 scoped_ptr<AudioPacket> packet(new AudioPacket()); 94 scoped_ptr<AudioPacket> packet(new AudioPacket());
95 packet->set_encoding(AudioPacket::ENCODING_RAW); 95 packet->set_encoding(AudioPacket::ENCODING_RAW);
96 packet->set_sampling_rate(rate); 96 packet->set_sampling_rate(rate);
97 packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2); 97 packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2);
98 packet->set_channels(AudioPacket::CHANNELS_STEREO); 98 packet->set_channels(AudioPacket::CHANNELS_STEREO);
99 99
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 // Attempt to consume a frame of 25 samples. 319 // Attempt to consume a frame of 25 samples.
320 ConsumeAudioFrame(); 320 ConsumeAudioFrame();
321 ASSERT_EQ(0, GetNumQueuedSamples()); 321 ASSERT_EQ(0, GetNumQueuedSamples());
322 ASSERT_EQ(0, GetNumQueuedPackets()); 322 ASSERT_EQ(0, GetNumQueuedPackets());
323 ASSERT_EQ(0, GetBytesConsumed()); 323 ASSERT_EQ(0, GetBytesConsumed());
324 CheckAudioFrameBytes(packet1_samples * kAudioSampleBytes); 324 CheckAudioFrameBytes(packet1_samples * kAudioSampleBytes);
325 } 325 }
326 326
327 } // namespace remoting 327 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/util_unittest.cc ('k') | remoting/codec/audio_encoder_opus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698