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

Unified Diff: media/audio/mac/audio_auhal_mac_unittest.cc

Issue 2023943002: Revert of Forward output glitch information from stream WebRTC log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_low_latency_input_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_auhal_mac_unittest.cc
diff --git a/media/audio/mac/audio_auhal_mac_unittest.cc b/media/audio/mac/audio_auhal_mac_unittest.cc
index 92ec12689e5cf3f0aa1798fc1ea6688d25afe251..8cc7cd9a8c93ccfbd657eda3f0741a332bb49880 100644
--- a/media/audio/mac/audio_auhal_mac_unittest.cc
+++ b/media/audio/mac/audio_auhal_mac_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/bind.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
@@ -28,9 +27,8 @@
arg0->Zero();
}
-ACTION_P3(MaybeSignalEvent, counter, signal_at_count, event) {
- if (++(*counter) == signal_at_count)
- event->Signal();
+ACTION_P(SignalEvent, event) {
+ event->Signal();
}
class AUHALStreamTest : public testing::Test {
@@ -47,21 +45,17 @@
AudioOutputStream* Create() {
return manager_->MakeAudioOutputStream(
- manager_->GetDefaultOutputStreamParameters(), "",
- base::Bind(&AUHALStreamTest::OnLogMessage, base::Unretained(this)));
+ manager_->GetDefaultOutputStreamParameters(), "");
}
bool OutputDevicesAvailable() {
return manager_->HasAudioOutputDevices();
}
- void OnLogMessage(const std::string& message) { log_message_ = message; }
-
protected:
base::TestMessageLoop message_loop_;
ScopedAudioManagerPtr manager_;
MockAudioSourceCallback source_;
- std::string log_message_;
private:
DISALLOW_COPY_AND_ASSIGN(AUHALStreamTest);
@@ -93,24 +87,16 @@
AudioOutputStream* stream = Create();
EXPECT_TRUE(stream->Open());
- // Wait for the first two data callback from the OS.
+ // Wait for the first data callback from the OS.
base::WaitableEvent event(false, false);
- int callback_counter = 0;
- const int number_of_callbacks = 2;
EXPECT_CALL(source_, OnMoreData(_, _, _))
- .Times(number_of_callbacks)
- .WillRepeatedly(DoAll(
- ZeroBuffer(),
- MaybeSignalEvent(&callback_counter, number_of_callbacks, &event),
- Return(0)));
+ .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0)));
EXPECT_CALL(source_, OnError(_)).Times(0);
stream->Start(&source_);
event.Wait();
stream->Stop();
stream->Close();
-
- EXPECT_FALSE(log_message_.empty());
}
} // namespace media
« no previous file with comments | « media/audio/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_low_latency_input_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698