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

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

Issue 487543002: Revert 290359 "Remove AudioBuffersState class." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/media/audio/win/audio_low_latency_output_win_unittest.cc
===================================================================
--- trunk/src/media/audio/win/audio_low_latency_output_win_unittest.cc (revision 290374)
+++ trunk/src/media/audio/win/audio_low_latency_output_win_unittest.cc (working copy)
@@ -52,7 +52,7 @@
// 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 >= value;
+ return arg.hardware_delay_bytes >= value.hardware_delay_bytes;
}
// Used to terminate a loop from a different thread than the loop belongs to.
@@ -103,7 +103,7 @@
// AudioOutputStream::AudioSourceCallback implementation.
virtual int OnMoreData(AudioBus* audio_bus,
- int total_bytes_delay) {
+ AudioBuffersState buffers_state) {
// 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,11 +396,14 @@
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- int bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
- (aosw.bits_per_sample() / 8);
+ 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);
+
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())));
@@ -597,11 +600,14 @@
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- int bytes_per_packet = aosw.channels() * aosw.samples_per_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);
+
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())))
@@ -635,11 +641,14 @@
EXPECT_TRUE(aos->Open());
// Derive the expected size in bytes of each packet.
- int bytes_per_packet = aosw.channels() * aosw.samples_per_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);
+
// Wait for the first callback and verify its parameters.
- EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
+ EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(state)))
.WillOnce(DoAll(
QuitLoop(loop.message_loop_proxy()),
Return(aosw.samples_per_packet())))
« no previous file with comments | « trunk/src/media/audio/win/audio_low_latency_output_win.cc ('k') | trunk/src/media/audio/win/audio_output_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698