| OLD | NEW |
| 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 Loading... |
| 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 OnCaptureResult(DesktopCapturer::Result result, | 34 void OnCaptureCompleted(DesktopFrame* frame) override { frame_.reset(frame); } |
| 35 std::unique_ptr<DesktopFrame> frame) override { | |
| 36 frame_ = std::move(frame); | |
| 37 } | |
| 38 | 35 |
| 39 protected: | 36 protected: |
| 40 std::unique_ptr<WindowCapturer> capturer_; | 37 std::unique_ptr<WindowCapturer> capturer_; |
| 41 std::unique_ptr<DesktopFrame> frame_; | 38 std::unique_ptr<DesktopFrame> frame_; |
| 42 }; | 39 }; |
| 43 | 40 |
| 44 // Verify that we can enumerate windows. | 41 // Verify that we can enumerate windows. |
| 45 TEST_F(WindowCapturerTest, Enumerate) { | 42 TEST_F(WindowCapturerTest, Enumerate) { |
| 46 WindowCapturer::WindowList windows; | 43 WindowCapturer::WindowList windows; |
| 47 EXPECT_TRUE(capturer_->GetWindowList(&windows)); | 44 EXPECT_TRUE(capturer_->GetWindowList(&windows)); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 80 } |
| 84 continue; | 81 continue; |
| 85 } | 82 } |
| 86 | 83 |
| 87 EXPECT_GT(frame_->size().width(), 0); | 84 EXPECT_GT(frame_->size().width(), 0); |
| 88 EXPECT_GT(frame_->size().height(), 0); | 85 EXPECT_GT(frame_->size().height(), 0); |
| 89 } | 86 } |
| 90 } | 87 } |
| 91 | 88 |
| 92 } // namespace webrtc | 89 } // namespace webrtc |
| OLD | NEW |