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

Side by Side Diff: webrtc/modules/desktop_capture/window_capturer_unittest.cc

Issue 1988783003: Use std::unique_ptr<> to pass frame ownership in DesktopCapturer impls. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 10
(...skipping 13 matching lines...) Expand all
24 public DesktopCapturer::Callback { 24 public DesktopCapturer::Callback {
25 public: 25 public:
26 void SetUp() override { 26 void SetUp() override {
27 capturer_.reset( 27 capturer_.reset(
28 WindowCapturer::Create(DesktopCaptureOptions::CreateDefault())); 28 WindowCapturer::Create(DesktopCaptureOptions::CreateDefault()));
29 } 29 }
30 30
31 void TearDown() override {} 31 void TearDown() override {}
32 32
33 // DesktopCapturer::Callback interface 33 // DesktopCapturer::Callback interface
34 void OnCaptureCompleted(DesktopFrame* frame) override { frame_.reset(frame); } 34 void OnCaptureResult(DesktopCapturer::Result result,
35 std::unique_ptr<DesktopFrame> frame) override {
36 frame_ = std::move(frame);
37 }
35 38
36 protected: 39 protected:
37 std::unique_ptr<WindowCapturer> capturer_; 40 std::unique_ptr<WindowCapturer> capturer_;
38 std::unique_ptr<DesktopFrame> frame_; 41 std::unique_ptr<DesktopFrame> frame_;
39 }; 42 };
40 43
41 // Verify that we can enumerate windows. 44 // Verify that we can enumerate windows.
42 TEST_F(WindowCapturerTest, Enumerate) { 45 TEST_F(WindowCapturerTest, Enumerate) {
43 WindowCapturer::WindowList windows; 46 WindowCapturer::WindowList windows;
44 EXPECT_TRUE(capturer_->GetWindowList(&windows)); 47 EXPECT_TRUE(capturer_->GetWindowList(&windows));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 83 }
81 continue; 84 continue;
82 } 85 }
83 86
84 EXPECT_GT(frame_->size().width(), 0); 87 EXPECT_GT(frame_->size().width(), 0);
85 EXPECT_GT(frame_->size().height(), 0); 88 EXPECT_GT(frame_->size().height(), 0);
86 } 89 }
87 } 90 }
88 91
89 } // namespace webrtc 92 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/window_capturer_null.cc ('k') | webrtc/modules/desktop_capture/window_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698