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

Side by Side Diff: media/base/audio_block_fifo_unittest.cc

Issue 661163004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « media/audio/sounds/sounds_manager_unittest.cc ('k') | media/base/audio_bus_unittest.cc » ('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 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 "base/time/time.h" 5 #include "base/time/time.h"
6 #include "media/audio/audio_power_monitor.h" 6 #include "media/audio/audio_power_monitor.h"
7 #include "media/base/audio_block_fifo.h" 7 #include "media/base/audio_block_fifo.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace media { 10 namespace media {
11 11
12 class AudioBlockFifoTest : public testing::Test { 12 class AudioBlockFifoTest : public testing::Test {
13 public: 13 public:
14 AudioBlockFifoTest() {} 14 AudioBlockFifoTest() {}
15 virtual ~AudioBlockFifoTest() {} 15 ~AudioBlockFifoTest() override {}
16 16
17 void PushAndVerify(AudioBlockFifo* fifo, int frames_to_push, 17 void PushAndVerify(AudioBlockFifo* fifo, int frames_to_push,
18 int channels, int block_frames, int max_frames) { 18 int channels, int block_frames, int max_frames) {
19 for (int filled_frames = max_frames - fifo->GetUnfilledFrames(); 19 for (int filled_frames = max_frames - fifo->GetUnfilledFrames();
20 filled_frames + frames_to_push <= max_frames;) { 20 filled_frames + frames_to_push <= max_frames;) {
21 Push(fifo, frames_to_push, channels); 21 Push(fifo, frames_to_push, channels);
22 filled_frames += frames_to_push; 22 filled_frames += frames_to_push;
23 EXPECT_EQ(max_frames - filled_frames, fifo->GetUnfilledFrames()); 23 EXPECT_EQ(max_frames - filled_frames, fifo->GetUnfilledFrames());
24 EXPECT_EQ(static_cast<int>(filled_frames / block_frames), 24 EXPECT_EQ(static_cast<int>(filled_frames / block_frames),
25 fifo->available_blocks()); 25 fifo->available_blocks());
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 expected_available_blocks); 217 expected_available_blocks);
218 } 218 }
219 219
220 // Fill up one block of buffer and consume it, FIFO should then be empty. 220 // Fill up one block of buffer and consume it, FIFO should then be empty.
221 const int available_frames = max_frames - expected_unfilled_frames; 221 const int available_frames = max_frames - expected_unfilled_frames;
222 Push(&fifo, frames - available_frames, channels); 222 Push(&fifo, frames - available_frames, channels);
223 ConsumeAndVerify(&fifo, max_frames, 0); 223 ConsumeAndVerify(&fifo, max_frames, 0);
224 } 224 }
225 225
226 } // namespace media 226 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/sounds/sounds_manager_unittest.cc ('k') | media/base/audio_bus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698