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

Side by Side Diff: components/copresence/mediums/audio/audio_player_unittest.cc

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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
OLDNEW
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 "components/copresence/mediums/audio/audio_player.h" 5 #include "components/copresence/mediums/audio/audio_player.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "components/copresence/mediums/audio/audio_player_impl.h" 9 #include "components/copresence/mediums/audio/audio_player_impl.h"
10 #include "components/copresence/public/copresence_constants.h" 10 #include "components/copresence/public/copresence_constants.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 namespace copresence { 71 namespace copresence {
72 72
73 class AudioPlayerTest : public testing::Test, 73 class AudioPlayerTest : public testing::Test,
74 public base::SupportsWeakPtr<AudioPlayerTest> { 74 public base::SupportsWeakPtr<AudioPlayerTest> {
75 public: 75 public:
76 AudioPlayerTest() : buffer_index_(0), player_(NULL) { 76 AudioPlayerTest() : buffer_index_(0), player_(NULL) {
77 if (!media::AudioManager::Get()) 77 if (!media::AudioManager::Get())
78 media::AudioManager::CreateForTesting(); 78 media::AudioManager::CreateForTesting();
79 } 79 }
80 80
81 virtual ~AudioPlayerTest() { DeletePlayer(); } 81 ~AudioPlayerTest() override { DeletePlayer(); }
82 82
83 void CreatePlayer() { 83 void CreatePlayer() {
84 DeletePlayer(); 84 DeletePlayer();
85 player_ = new AudioPlayerImpl(); 85 player_ = new AudioPlayerImpl();
86 player_->set_output_stream_for_testing(new TestAudioOutputStream( 86 player_->set_output_stream_for_testing(new TestAudioOutputStream(
87 kDefaultFrameCount, 87 kDefaultFrameCount,
88 kMaxFrameCount, 88 kMaxFrameCount,
89 base::Bind(&AudioPlayerTest::GatherSamples, AsWeakPtr()))); 89 base::Bind(&AudioPlayerTest::GatherSamples, AsWeakPtr())));
90 player_->Initialize(); 90 player_->Initialize();
91 } 91 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 TEST_F(AudioPlayerTest, PlayingEndToEnd) { 182 TEST_F(AudioPlayerTest, PlayingEndToEnd) {
183 const int kNumSamples = kDefaultFrameCount * 10; 183 const int kNumSamples = kDefaultFrameCount * 10;
184 CreatePlayer(); 184 CreatePlayer();
185 185
186 PlayAndVerifySamples(CreateRandomAudioRefCounted(0x1337, 1, kNumSamples)); 186 PlayAndVerifySamples(CreateRandomAudioRefCounted(0x1337, 1, kNumSamples));
187 187
188 DeletePlayer(); 188 DeletePlayer();
189 } 189 }
190 190
191 } // namespace copresence 191 } // namespace copresence
OLDNEW
« no previous file with comments | « components/copresence/mediums/audio/audio_player_impl.h ('k') | components/copresence/mediums/audio/audio_recorder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698