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

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: Now builds 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 | webrtc/modules/audio_device/dummy/file_audio_device.h » ('j') | 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..6747f9cc6d5aeb2c55bb9d5a1a6e56ea5df81bd2 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_;
« no previous file with comments | « no previous file | webrtc/modules/audio_device/dummy/file_audio_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698