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

Unified Diff: media/audio/win/audio_low_latency_output_win_unittest.cc

Issue 467833002: Remove AudioBuffersState class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_low_latency_output_win.cc ('k') | media/audio/win/audio_output_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/audio_low_latency_output_win_unittest.cc
diff --git a/media/audio/win/audio_low_latency_output_win_unittest.cc b/media/audio/win/audio_low_latency_output_win_unittest.cc
index ed03d2b714d664321edc15b6e97d54bb5fd2f44a..30fa9ca972d5e9a106d9d035b78ed7d326be9d26 100644
--- a/media/audio/win/audio_low_latency_output_win_unittest.cc
+++ b/media/audio/win/audio_low_latency_output_win_unittest.cc
@@ -52,7 +52,7 @@ MATCHER_P(HasValidDelay, value, "") {
// It is difficult to come up with a perfect test condition for the delay
// estimation. For now, verify that the produced output delay is always
// larger than the selected buffer size.
- return arg.hardware_delay_bytes >= value.hardware_delay_bytes;
+ return arg >= value;
}
// Used to terminate a loop from a different thread than the loop belongs to.
@@ -103,7 +103,7 @@ class ReadFromFileAudioSource : public AudioOutputStream::AudioSourceCallback {
// AudioOutputStream::AudioSourceCallback implementation.
virtual int OnMoreData(AudioBus* audio_bus,
- AudioBuffersState buffers_state) {
+ int total_bytes_delay) {
// Store time difference between two successive callbacks in an array.
// These values will be written to a file in the destructor.
const base::TimeTicks now_time = base::TimeTicks::Now();
@@ -396,14 +396,11 @@ TEST(WASAPIAudioOutputStreamTest, ValidPacketSize) {
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- uint32 bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
- (aosw.bits_per_sample() / 8);
-
- // Set up expected minimum delay estimation.
- AudioBuffersState state(0, bytes_per_packet);
+ int bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
+ (aosw.bits_per_sample() / 8);
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())));
@@ -600,14 +597,11 @@ TEST(WASAPIAudioOutputStreamTest, ExclusiveModeMinBufferSizeAt48kHz) {
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- uint32 bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
+ int bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
(aosw.bits_per_sample() / 8);
- // Set up expected minimum delay estimation.
- AudioBuffersState state(0, bytes_per_packet);
-
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())))
@@ -641,14 +635,11 @@ TEST(WASAPIAudioOutputStreamTest, ExclusiveModeMinBufferSizeAt44kHz) {
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- uint32 bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
+ int bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
(aosw.bits_per_sample() / 8);
- // Set up expected minimum delay estimation.
- AudioBuffersState state(0, bytes_per_packet);
-
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())))
« no previous file with comments | « media/audio/win/audio_low_latency_output_win.cc ('k') | media/audio/win/audio_output_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698