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 25 matching lines...) Expand all Loading... |
36 it.Advance(); | 36 it.Advance(); |
37 } | 37 } |
38 EXPECT_TRUE(it.IsAtEnd()); | 38 EXPECT_TRUE(it.IsAtEnd()); |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 // Verify that regions are empty when created. | 43 // Verify that regions are empty when created. |
44 TEST(DesktopRegionTest, Empty) { | 44 TEST(DesktopRegionTest, Empty) { |
45 DesktopRegion r; | 45 DesktopRegion r; |
46 CompareRegion(r, NULL, 0); | 46 CompareRegion(r, nullptr, 0); |
47 } | 47 } |
48 | 48 |
49 // Verify that empty rectangles are ignored. | 49 // Verify that empty rectangles are ignored. |
50 TEST(DesktopRegionTest, AddEmpty) { | 50 TEST(DesktopRegionTest, AddEmpty) { |
51 DesktopRegion r; | 51 DesktopRegion r; |
52 DesktopRect rect = DesktopRect::MakeXYWH(1, 2, 0, 0); | 52 DesktopRect rect = DesktopRect::MakeXYWH(1, 2, 0, 0); |
53 r.AddRect(rect); | 53 r.AddRect(rect); |
54 CompareRegion(r, NULL, 0); | 54 CompareRegion(r, nullptr, 0); |
55 } | 55 } |
56 | 56 |
57 // Verify that regions with a single rectangles are handled properly. | 57 // Verify that regions with a single rectangles are handled properly. |
58 TEST(DesktopRegionTest, SingleRect) { | 58 TEST(DesktopRegionTest, SingleRect) { |
59 DesktopRegion r; | 59 DesktopRegion r; |
60 DesktopRect rect = DesktopRect::MakeXYWH(1, 2, 3, 4); | 60 DesktopRect rect = DesktopRect::MakeXYWH(1, 2, 3, 4); |
61 r.AddRect(rect); | 61 r.AddRect(rect); |
62 CompareRegion(r, &rect, 1); | 62 CompareRegion(r, &rect, 1); |
63 } | 63 } |
64 | 64 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 5 + RadmonInt(10) * 5, 5 + RadmonInt(10) * 5)); | 701 5 + RadmonInt(10) * 5, 5 + RadmonInt(10) * 5)); |
702 } | 702 } |
703 | 703 |
704 // Iterate over the rectangles. | 704 // Iterate over the rectangles. |
705 for (DesktopRegion::Iterator it(r); !it.IsAtEnd(); it.Advance()) { | 705 for (DesktopRegion::Iterator it(r); !it.IsAtEnd(); it.Advance()) { |
706 } | 706 } |
707 } | 707 } |
708 } | 708 } |
709 | 709 |
710 } // namespace webrtc | 710 } // namespace webrtc |
OLD | NEW |