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

Unified Diff: media/blink/webaudiosourceprovider_impl_unittest.cc

Issue 2567143002: media::SilentSinkSuspender should simulate |delay| and |delay_timestamp| (Closed)
Patch Set: build fix content_unittets & media_blink_unittsests Created 3 years, 11 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/base/silent_sink_suspender_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webaudiosourceprovider_impl_unittest.cc
diff --git a/media/blink/webaudiosourceprovider_impl_unittest.cc b/media/blink/webaudiosourceprovider_impl_unittest.cc
index fdc51b1ebecbdbe846bb2581e07b06b79825e666..0a3b6bfd5131d247aee8fc306dc5dc54f576f855 100644
--- a/media/blink/webaudiosourceprovider_impl_unittest.cc
+++ b/media/blink/webaudiosourceprovider_impl_unittest.cc
@@ -23,6 +23,7 @@ namespace media {
namespace {
const float kTestVolume = 0.25;
+const int kSampleRate = 48000;
class WebAudioSourceProviderImplUnderTest : public WebAudioSourceProviderImpl {
public:
@@ -64,10 +65,10 @@ class WebAudioSourceProviderImplTest
WebAudioSourceProviderImplTest()
: params_(AudioParameters::AUDIO_PCM_LINEAR,
CHANNEL_LAYOUT_STEREO,
- 48000,
+ kSampleRate,
16,
64),
- fake_callback_(0.1),
+ fake_callback_(0.1, kSampleRate),
mock_sink_(CreateWaspMockSink(GetParam())),
wasp_impl_(new WebAudioSourceProviderImplUnderTest(mock_sink_)),
expected_sink_(GetParam() == WaspSinkStatus::WASP_SINK_OK
@@ -259,7 +260,7 @@ TEST_P(WebAudioSourceProviderImplTest, ProvideInput) {
bus2->Zero();
wasp_impl_->provideInput(audio_data, params_.frames_per_buffer());
ASSERT_TRUE(CompareBusses(bus1.get(), bus2.get()));
- ASSERT_EQ(fake_callback_.last_frames_delayed(), -1);
+ ASSERT_EQ(fake_callback_.last_delay(), base::TimeDelta::Max());
wasp_impl_->Start();
@@ -267,7 +268,7 @@ TEST_P(WebAudioSourceProviderImplTest, ProvideInput) {
bus1->channel(0)[0] = 1;
wasp_impl_->provideInput(audio_data, params_.frames_per_buffer());
ASSERT_TRUE(CompareBusses(bus1.get(), bus2.get()));
- ASSERT_EQ(fake_callback_.last_frames_delayed(), -1);
+ ASSERT_EQ(fake_callback_.last_delay(), base::TimeDelta::Max());
wasp_impl_->Play();
« no previous file with comments | « media/base/silent_sink_suspender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698