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

Side by Side Diff: webrtc/call/bitrate_estimator_tests.cc

Issue 1789903003: Replace scoped_ptr with unique_ptr in webrtc/call/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include <functional> 10 #include <functional>
11 #include <list> 11 #include <list>
12 #include <memory>
12 #include <string> 13 #include <string>
13 14
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 #include "webrtc/audio_state.h" 17 #include "webrtc/audio_state.h"
17 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
18 #include "webrtc/base/event.h" 19 #include "webrtc/base/event.h"
19 #include "webrtc/base/logging.h" 20 #include "webrtc/base/logging.h"
20 #include "webrtc/base/scoped_ptr.h"
21 #include "webrtc/base/thread_annotations.h" 21 #include "webrtc/base/thread_annotations.h"
22 #include "webrtc/call.h" 22 #include "webrtc/call.h"
23 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 23 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
24 #include "webrtc/system_wrappers/include/trace.h" 24 #include "webrtc/system_wrappers/include/trace.h"
25 #include "webrtc/test/call_test.h" 25 #include "webrtc/test/call_test.h"
26 #include "webrtc/test/direct_transport.h" 26 #include "webrtc/test/direct_transport.h"
27 #include "webrtc/test/encoder_settings.h" 27 #include "webrtc/test/encoder_settings.h"
28 #include "webrtc/test/fake_decoder.h" 28 #include "webrtc/test/fake_decoder.h"
29 #include "webrtc/test/fake_encoder.h" 29 #include "webrtc/test/fake_encoder.h"
30 #include "webrtc/test/mock_voice_engine.h" 30 #include "webrtc/test/mock_voice_engine.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 is_sending_receiving_ = false; 236 is_sending_receiving_ = false;
237 } 237 }
238 } 238 }
239 239
240 private: 240 private:
241 BitrateEstimatorTest* test_; 241 BitrateEstimatorTest* test_;
242 bool is_sending_receiving_; 242 bool is_sending_receiving_;
243 VideoSendStream* send_stream_; 243 VideoSendStream* send_stream_;
244 AudioReceiveStream* audio_receive_stream_; 244 AudioReceiveStream* audio_receive_stream_;
245 VideoReceiveStream* video_receive_stream_; 245 VideoReceiveStream* video_receive_stream_;
246 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; 246 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
247 test::FakeEncoder fake_encoder_; 247 test::FakeEncoder fake_encoder_;
248 test::FakeDecoder fake_decoder_; 248 test::FakeDecoder fake_decoder_;
249 }; 249 };
250 250
251 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; 251 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_;
252 LogObserver receiver_log_; 252 LogObserver receiver_log_;
253 rtc::scoped_ptr<test::DirectTransport> send_transport_; 253 std::unique_ptr<test::DirectTransport> send_transport_;
254 rtc::scoped_ptr<test::DirectTransport> receive_transport_; 254 std::unique_ptr<test::DirectTransport> receive_transport_;
255 rtc::scoped_ptr<Call> sender_call_; 255 std::unique_ptr<Call> sender_call_;
256 rtc::scoped_ptr<Call> receiver_call_; 256 std::unique_ptr<Call> receiver_call_;
257 VideoReceiveStream::Config receive_config_; 257 VideoReceiveStream::Config receive_config_;
258 std::vector<Stream*> streams_; 258 std::vector<Stream*> streams_;
259 }; 259 };
260 260
261 static const char* kAbsSendTimeLog = 261 static const char* kAbsSendTimeLog =
262 "RemoteBitrateEstimatorAbsSendTime: Instantiating."; 262 "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
263 static const char* kSingleStreamLog = 263 static const char* kSingleStreamLog =
264 "RemoteBitrateEstimatorSingleStream: Instantiating."; 264 "RemoteBitrateEstimatorSingleStream: Instantiating.";
265 265
266 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) { 266 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); 322 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId);
323 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 323 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
324 receiver_log_.PushExpectedLogLine( 324 receiver_log_.PushExpectedLogLine(
325 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); 325 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
326 streams_.push_back(new Stream(this, false)); 326 streams_.push_back(new Stream(this, false));
327 streams_[0]->StopSending(); 327 streams_[0]->StopSending();
328 streams_[1]->StopSending(); 328 streams_[1]->StopSending();
329 EXPECT_TRUE(receiver_log_.Wait()); 329 EXPECT_TRUE(receiver_log_.Wait());
330 } 330 }
331 } // namespace webrtc 331 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698