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 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "webrtc/test/gmock.h" | |
14 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 13 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
15 #include "webrtc/modules/desktop_capture/desktop_geometry.h" | 14 #include "webrtc/modules/desktop_capture/desktop_geometry.h" |
16 #include "webrtc/modules/desktop_capture/mouse_cursor.h" | 15 #include "webrtc/modules/desktop_capture/mouse_cursor.h" |
17 #include "webrtc/modules/desktop_capture/win/cursor.h" | 16 #include "webrtc/modules/desktop_capture/win/cursor.h" |
18 #include "webrtc/modules/desktop_capture/win/cursor_unittest_resources.h" | 17 #include "webrtc/modules/desktop_capture/win/cursor_unittest_resources.h" |
19 #include "webrtc/modules/desktop_capture/win/scoped_gdi_object.h" | 18 #include "webrtc/modules/desktop_capture/win/scoped_gdi_object.h" |
| 19 #include "webrtc/test/gmock.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Loads |left| from resources, converts it to a |MouseCursor| instance and | 25 // Loads |left| from resources, converts it to a |MouseCursor| instance and |
26 // compares pixels with |right|. Returns true of MouseCursor bits match |right|. | 26 // compares pixels with |right|. Returns true of MouseCursor bits match |right|. |
27 // |right| must be a 32bpp cursor with alpha channel. | 27 // |right| must be a 32bpp cursor with alpha channel. |
28 bool ConvertToMouseShapeAndCompare(unsigned left, unsigned right) { | 28 bool ConvertToMouseShapeAndCompare(unsigned left, unsigned right) { |
29 HMODULE instance = GetModuleHandle(NULL); | 29 HMODULE instance = GetModuleHandle(NULL); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 IDD_CURSOR1_32BPP)); | 81 IDD_CURSOR1_32BPP)); |
82 | 82 |
83 EXPECT_TRUE(ConvertToMouseShapeAndCompare(IDD_CURSOR2_1BPP, | 83 EXPECT_TRUE(ConvertToMouseShapeAndCompare(IDD_CURSOR2_1BPP, |
84 IDD_CURSOR2_32BPP)); | 84 IDD_CURSOR2_32BPP)); |
85 | 85 |
86 EXPECT_TRUE(ConvertToMouseShapeAndCompare(IDD_CURSOR3_4BPP, | 86 EXPECT_TRUE(ConvertToMouseShapeAndCompare(IDD_CURSOR3_4BPP, |
87 IDD_CURSOR3_32BPP)); | 87 IDD_CURSOR3_32BPP)); |
88 } | 88 } |
89 | 89 |
90 } // namespace webrtc | 90 } // namespace webrtc |
OLD | NEW |