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

Unified Diff: webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc

Issue 1743203002: Replace scoped_ptr with unique_ptr in webrtc/modules/desktop_capture/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More Windows reverts 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
diff --git a/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc b/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
index 4835fc56c67021ffa04c275754094fdf64d28226..6652a1af71e1125e02bfca000539cbdf2a45e971 100644
--- a/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
+++ b/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
@@ -8,10 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "webrtc/modules/desktop_capture/desktop_and_cursor_composer.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/mouse_cursor.h"
@@ -87,7 +88,7 @@ class FakeScreenCapturer : public DesktopCapturer {
private:
Callback* callback_;
- rtc::scoped_ptr<DesktopFrame> next_frame_;
+ std::unique_ptr<DesktopFrame> next_frame_;
};
class FakeMouseMonitor : public MouseCursorMonitor {
@@ -109,7 +110,7 @@ class FakeMouseMonitor : public MouseCursorMonitor {
void Capture() override {
if (changed_) {
- rtc::scoped_ptr<DesktopFrame> image(
+ std::unique_ptr<DesktopFrame> image(
new BasicDesktopFrame(DesktopSize(kCursorWidth, kCursorHeight)));
uint32_t* data = reinterpret_cast<uint32_t*>(image->data());
memset(data, 0, image->stride() * kCursorHeight);
@@ -176,7 +177,7 @@ class DesktopAndCursorComposerTest : public testing::Test,
FakeMouseMonitor* fake_cursor_;
DesktopAndCursorComposer blender_;
- rtc::scoped_ptr<DesktopFrame> frame_;
+ std::unique_ptr<DesktopFrame> frame_;
};
// Verify DesktopAndCursorComposer can handle the case when the screen capturer
@@ -190,7 +191,7 @@ TEST_F(DesktopAndCursorComposerTest, Error) {
blender_.Capture(DesktopRegion());
- EXPECT_EQ(frame_, static_cast<DesktopFrame*>(NULL));
+ EXPECT_FALSE(frame_);
}
TEST_F(DesktopAndCursorComposerTest, Blend) {
@@ -228,7 +229,7 @@ TEST_F(DesktopAndCursorComposerTest, Blend) {
DesktopVector pos(tests[i].x, tests[i].y);
fake_cursor_->SetState(state, pos);
- rtc::scoped_ptr<SharedDesktopFrame> frame(
+ std::unique_ptr<SharedDesktopFrame> frame(
SharedDesktopFrame::Wrap(CreateTestFrame()));
fake_screen_->SetNextFrame(frame->Share());

Powered by Google App Engine
This is Rietveld 408576698