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

Unified Diff: media/audio/audio_output_device_unittest.cc

Issue 2452183003: Revert of Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Created 4 years, 2 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/audio_output_device.cc ('k') | media/audio/audio_output_stream_sink.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_device_unittest.cc
diff --git a/media/audio/audio_output_device_unittest.cc b/media/audio/audio_output_device_unittest.cc
index 49eb42761c7f9a69877322465c22680fffb1a597..70a9b3902b8a4bb4ae0164c4a98aadde174eb33b 100644
--- a/media/audio/audio_output_device_unittest.cc
+++ b/media/audio/audio_output_device_unittest.cc
@@ -53,11 +53,10 @@
MockRenderCallback() {}
virtual ~MockRenderCallback() {}
- MOCK_METHOD4(Render,
- int(base::TimeDelta delay,
- base::TimeTicks timestamp,
- int prior_frames_skipped,
- AudioBus* dest));
+ MOCK_METHOD3(Render,
+ int(AudioBus* dest,
+ uint32_t frames_delayed,
+ uint32_t frames_skipped));
MOCK_METHOD0(OnRenderError, void());
};
@@ -80,11 +79,8 @@
MOCK_METHOD1(SetVolume, void(double volume));
};
-ACTION_P2(SendPendingData, socket, delay) {
- const auto delay_timestamp = base::TimeTicks::Now();
- media::AudioDeviceThread::Packet packet = {delay.ToInternalValue(),
- delay_timestamp.ToInternalValue()};
- socket->Send(&packet, sizeof(packet));
+ACTION_P2(SendPendingBytes, socket, pending_bytes) {
+ socket->Send(&pending_bytes, sizeof(pending_bytes));
}
// Used to terminate a loop from a different thread than the loop belongs to.
@@ -231,9 +227,10 @@
// Respond by asking for some audio data. This should ask our callback
// to provide some audio data that AudioOutputDevice then writes into the
// shared memory section.
- const auto delay = base::TimeDelta::FromSeconds(1);
+ const int kMemorySize = CalculateMemorySize();
+
EXPECT_CALL(*audio_output_ipc_, PlayStream())
- .WillOnce(SendPendingData(&browser_socket_, delay));
+ .WillOnce(SendPendingBytes(&browser_socket_, kMemorySize));
// We expect calls to our audio renderer callback, which returns the number
// of frames written to the memory section.
@@ -243,7 +240,7 @@
// So, for the sake of this test, we consider the call to Render a sign
// of success and quit the loop.
const int kNumberOfFramesToProcess = 0;
- EXPECT_CALL(callback_, Render(_, _, _, _))
+ EXPECT_CALL(callback_, Render(_, _, _))
.WillOnce(DoAll(QuitLoop(io_loop_.task_runner()),
Return(kNumberOfFramesToProcess)));
}
« no previous file with comments | « media/audio/audio_output_device.cc ('k') | media/audio/audio_output_stream_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698