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

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

Issue 1909593002: Cleanup webrtc/modules/desktop_capture (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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
11 #include "webrtc/modules/desktop_capture/screen_capturer.h" 11 #include "webrtc/modules/desktop_capture/screen_capturer.h"
12 12
13 #include <ApplicationServices/ApplicationServices.h> 13 #include <ApplicationServices/ApplicationServices.h>
14 14
15 #include <memory> 15 #include <memory>
16 #include <ostream> 16 #include <ostream>
17 17
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "webrtc/modules/desktop_capture/desktop_capture_options.h"
19 #include "webrtc/modules/desktop_capture/desktop_frame.h" 20 #include "webrtc/modules/desktop_capture/desktop_frame.h"
20 #include "webrtc/modules/desktop_capture/desktop_geometry.h" 21 #include "webrtc/modules/desktop_capture/desktop_geometry.h"
21 #include "webrtc/modules/desktop_capture/desktop_region.h" 22 #include "webrtc/modules/desktop_capture/desktop_region.h"
22 #include "webrtc/modules/desktop_capture/mac/desktop_configuration.h" 23 #include "webrtc/modules/desktop_capture/mac/desktop_configuration.h"
23 #include "webrtc/modules/desktop_capture/screen_capturer_mock_objects.h" 24 #include "webrtc/modules/desktop_capture/screen_capturer_mock_objects.h"
24 25
25 using ::testing::_; 26 using ::testing::_;
26 using ::testing::AnyNumber; 27 using ::testing::AnyNumber;
27 using ::testing::Return; 28 using ::testing::Return;
28 29
29 namespace webrtc { 30 namespace webrtc {
30 31
31 class ScreenCapturerMacTest : public testing::Test { 32 class ScreenCapturerMacTest : public testing::Test {
32 public: 33 public:
33 // Verifies that the whole screen is initially dirty. 34 // Verifies that the whole screen is initially dirty.
34 void CaptureDoneCallback1(DesktopFrame* frame); 35 void CaptureDoneCallback1(DesktopFrame* frame);
35 36
36 // Verifies that a rectangle explicitly marked as dirty is propagated 37 // Verifies that a rectangle explicitly marked as dirty is propagated
37 // correctly. 38 // correctly.
38 void CaptureDoneCallback2(DesktopFrame* frame); 39 void CaptureDoneCallback2(DesktopFrame* frame);
39 40
40 protected: 41 protected:
41 void SetUp() override { capturer_.reset(ScreenCapturer::Create()); } 42 void SetUp() override {
43 capturer_.reset(
44 ScreenCapturer::Create(DesktopCaptureOptions::CreateDefault()));
45 }
42 46
43 std::unique_ptr<ScreenCapturer> capturer_; 47 std::unique_ptr<ScreenCapturer> capturer_;
44 MockScreenCapturerCallback callback_; 48 MockScreenCapturerCallback callback_;
45 }; 49 };
46 50
47 void ScreenCapturerMacTest::CaptureDoneCallback1( 51 void ScreenCapturerMacTest::CaptureDoneCallback1(
48 DesktopFrame* frame) { 52 DesktopFrame* frame) {
49 std::unique_ptr<DesktopFrame> owned_frame(frame); 53 std::unique_ptr<DesktopFrame> owned_frame(frame);
50 54
51 MacDesktopConfiguration config = MacDesktopConfiguration::GetCurrent( 55 MacDesktopConfiguration config = MacDesktopConfiguration::GetCurrent(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 capturer_->Start(&callback_); 88 capturer_->Start(&callback_);
85 89
86 // Check that we get an initial full-screen updated. 90 // Check that we get an initial full-screen updated.
87 capturer_->Capture(DesktopRegion()); 91 capturer_->Capture(DesktopRegion());
88 92
89 // Check that subsequent dirty rects are propagated correctly. 93 // Check that subsequent dirty rects are propagated correctly.
90 capturer_->Capture(DesktopRegion()); 94 capturer_->Capture(DesktopRegion());
91 } 95 }
92 96
93 } // namespace webrtc 97 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer.cc ('k') | webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698