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

Unified Diff: webrtc/modules/audio_device/ios/audio_device_unittest_ios.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 | « webrtc/modules/audio_device/dummy/file_audio_device.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc
diff --git a/webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc b/webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc
index ef6178bb4b1e8871a014c3f3d05f3831c1be2a29..76c50cbc791f3488d3490fd8eb610b2f33d93bfc 100644
--- a/webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc
+++ b/webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc
@@ -21,11 +21,11 @@
#include "webrtc/base/format_macros.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/base/timeutils.h"
#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/modules/audio_device/ios/audio_device_ios.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"
@@ -247,8 +247,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),
@@ -264,7 +263,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();
@@ -294,7 +293,7 @@ class LatencyMeasuringAudioStream : public AudioStreamInterface {
std::distance(vec.begin(), std::find(vec.begin(), vec.end(), 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);
@@ -348,7 +347,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 | « webrtc/modules/audio_device/dummy/file_audio_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698