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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 TEST_F(WindowCapturerTest, Capture) { | 63 TEST_F(WindowCapturerTest, Capture) { |
64 WindowCapturer::WindowList windows; | 64 WindowCapturer::WindowList windows; |
65 capturer_->Start(this); | 65 capturer_->Start(this); |
66 EXPECT_TRUE(capturer_->GetWindowList(&windows)); | 66 EXPECT_TRUE(capturer_->GetWindowList(&windows)); |
67 | 67 |
68 // Verify that we can select and capture each window. | 68 // Verify that we can select and capture each window. |
69 for (WindowCapturer::WindowList::iterator it = windows.begin(); | 69 for (WindowCapturer::WindowList::iterator it = windows.begin(); |
70 it != windows.end(); ++it) { | 70 it != windows.end(); ++it) { |
71 frame_.reset(); | 71 frame_.reset(); |
72 if (capturer_->SelectWindow(it->id)) { | 72 if (capturer_->SelectWindow(it->id)) { |
73 capturer_->Capture(DesktopRegion()); | 73 capturer_->CaptureFrame(); |
74 } | 74 } |
75 | 75 |
76 // If we failed to capture a window make sure it no longer exists. | 76 // If we failed to capture a window make sure it no longer exists. |
77 if (!frame_.get()) { | 77 if (!frame_.get()) { |
78 WindowCapturer::WindowList new_list; | 78 WindowCapturer::WindowList new_list; |
79 EXPECT_TRUE(capturer_->GetWindowList(&new_list)); | 79 EXPECT_TRUE(capturer_->GetWindowList(&new_list)); |
80 for (WindowCapturer::WindowList::iterator new_list_it = new_list.begin(); | 80 for (WindowCapturer::WindowList::iterator new_list_it = new_list.begin(); |
81 new_list_it != new_list.end(); ++new_list_it) { | 81 new_list_it != new_list.end(); ++new_list_it) { |
82 EXPECT_FALSE(it->id == new_list_it->id); | 82 EXPECT_FALSE(it->id == new_list_it->id); |
83 } | 83 } |
84 continue; | 84 continue; |
85 } | 85 } |
86 | 86 |
87 EXPECT_GT(frame_->size().width(), 0); | 87 EXPECT_GT(frame_->size().width(), 0); |
88 EXPECT_GT(frame_->size().height(), 0); | 88 EXPECT_GT(frame_->size().height(), 0); |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 } // namespace webrtc | 92 } // namespace webrtc |
OLD | NEW |