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

Unified Diff: webrtc/modules/utility/source/file_player_unittests.cc

Issue 2049683003: FileRecorder + FilePlayer: Let Create functions return unique_ptr (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@remove3
Patch Set: Created 4 years, 4 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
Index: webrtc/modules/utility/source/file_player_unittests.cc
diff --git a/webrtc/modules/utility/source/file_player_unittests.cc b/webrtc/modules/utility/source/file_player_unittests.cc
index 1008daf821d2351fb7f500cc895a60e8acd79330..8c709527f40cbc94a3978f3596eb20465ef39d45 100644
--- a/webrtc/modules/utility/source/file_player_unittests.cc
+++ b/webrtc/modules/utility/source/file_player_unittests.cc
@@ -13,6 +13,8 @@
#include "webrtc/modules/utility/include/file_player.h"
#include <stdio.h>
+
+#include <memory>
#include <string>
#include "gflags/gflags.h"
@@ -32,7 +34,7 @@ class FilePlayerTest : public ::testing::Test {
static const int kSampleRateHz = 8000;
FilePlayerTest()
- : player_(FilePlayer::CreateFilePlayer(kId, kFileFormat)),
+ : player_(FilePlayer::NewFilePlayer(kId, kFileFormat)),
output_file_(NULL) {}
void SetUp() override {
@@ -49,8 +51,6 @@ class FilePlayerTest : public ::testing::Test {
fclose(output_file_);
}
- ~FilePlayerTest() { FilePlayer::DestroyFilePlayer(player_); }
-
void PlayFileAndCheck(const std::string& input_file,
const std::string& ref_checksum,
int output_length_ms) {
@@ -76,7 +76,7 @@ class FilePlayerTest : public ::testing::Test {
rtc::hex_encode(checksum_result, sizeof(checksum_result)));
}
- FilePlayer* player_;
+ std::unique_ptr<FilePlayer> player_;
FILE* output_file_;
};

Powered by Google App Engine
This is Rietveld 408576698