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

Unified Diff: webrtc/modules/audio_device/android/audio_device_unittest.cc

Issue 2501603002: Removes usage of system_wrappers/include/clock.h in audio_device/ (Closed)
Patch Set: cleanup Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/audio_device_unittest.cc
diff --git a/webrtc/modules/audio_device/android/audio_device_unittest.cc b/webrtc/modules/audio_device/android/audio_device_unittest.cc
index c31e14e1c6fd0c8dc3657407c80071e3896f1b70..2328929b6d796350bfe37c83722236e2d26ebfec 100644
--- a/webrtc/modules/audio_device/android/audio_device_unittest.cc
+++ b/webrtc/modules/audio_device/android/audio_device_unittest.cc
@@ -20,6 +20,7 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/format_macros.h"
#include "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/base/timeutils.h"
#include "webrtc/modules/audio_device/android/audio_common.h"
#include "webrtc/modules/audio_device/android/audio_manager.h"
#include "webrtc/modules/audio_device/android/build_info.h"
@@ -27,7 +28,6 @@
#include "webrtc/modules/audio_device/audio_device_impl.h"
#include "webrtc/modules/audio_device/include/audio_device.h"
#include "webrtc/modules/audio_device/include/mock_audio_transport.h"
-#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/test/gmock.h"
@@ -252,8 +252,7 @@ class FifoAudioStream : public AudioStreamInterface {
class LatencyMeasuringAudioStream : public AudioStreamInterface {
public:
explicit LatencyMeasuringAudioStream(size_t frames_per_buffer)
- : clock_(Clock::GetRealTimeClock()),
- frames_per_buffer_(frames_per_buffer),
+ : frames_per_buffer_(frames_per_buffer),
bytes_per_buffer_(frames_per_buffer_ * sizeof(int16_t)),
play_count_(0),
rec_count_(0),
@@ -270,7 +269,7 @@ class LatencyMeasuringAudioStream : public AudioStreamInterface {
memset(destination, 0, bytes_per_buffer_);
if (play_count_ % (kNumCallbacksPerSecond / kImpulseFrequencyInHz) == 0) {
if (pulse_time_ == 0) {
- pulse_time_ = clock_->TimeInMilliseconds();
+ pulse_time_ = rtc::TimeMillis();
}
PRINT(".");
const int16_t impulse = std::numeric_limits<int16_t>::max();
@@ -301,7 +300,7 @@ class LatencyMeasuringAudioStream : public AudioStreamInterface {
max));
if (max > kImpulseThreshold) {
PRINTD("(%d,%d)", max, index_of_max);
- int64_t now_time = clock_->TimeInMilliseconds();
+ int64_t now_time = rtc::TimeMillis();
int extra_delay = IndexToMilliseconds(static_cast<double> (index_of_max));
PRINTD("[%d]", static_cast<int> (now_time - pulse_time_));
PRINTD("[%d]", extra_delay);
@@ -356,7 +355,6 @@ class LatencyMeasuringAudioStream : public AudioStreamInterface {
}
private:
- Clock* clock_;
const size_t frames_per_buffer_;
const size_t bytes_per_buffer_;
size_t play_count_;
@@ -999,7 +997,7 @@ TEST_F(AudioDeviceTest, RunPlayoutAndRecordingInFullDuplex) {
// - Store time differences in a vector and calculate min, max and average.
// This test requires a special hardware called Audio Loopback Dongle.
// See http://source.android.com/devices/audio/loopback.html for details.
-TEST_F(AudioDeviceTest, DISABLED_MeasureLoopbackLatency) {
+TEST_F(AudioDeviceTest, MeasureLoopbackLatency) {
nisse-webrtc 2016/11/15 08:12:33 Nice it the test can now be enabled, but it's uncl
EXPECT_EQ(record_channels(), playout_channels());
EXPECT_EQ(record_sample_rate(), playout_sample_rate());
NiceMock<MockAudioTransportAndroid> mock(kPlayout | kRecording);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698