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

Side by Side Diff: remoting/capturer/video_frame_capturer_mac_unittest.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/video_frame_capturer.h" 5 #include "remoting/capturer/video_frame_capturer.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 8
9 #include <ostream> 9 #include <ostream>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "remoting/base/capture_data.h" 14 #include "remoting/capturer/capture_data.h"
15 #include "remoting/host/host_mock_objects.h" 15 #include "remoting/capturer/capturer_mock_objects.h"
16 #include "remoting/proto/control.pb.h"
17 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
18 17
19 using ::testing::_; 18 using ::testing::_;
20 using ::testing::AnyNumber; 19 using ::testing::AnyNumber;
21 20
22 namespace remoting { 21 namespace remoting {
23 22
24 // Verify that the OS is at least Snow Leopard (10.6). 23 // Verify that the OS is at least Snow Leopard (10.6).
25 // Chromoting doesn't support 10.5 or earlier. 24 // Chromoting doesn't support 10.5 or earlier.
26 bool CheckSnowLeopard() { 25 bool CheckSnowLeopard() {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 85
87 TEST_F(VideoFrameCapturerMacTest, Capture) { 86 TEST_F(VideoFrameCapturerMacTest, Capture) {
88 if (!CheckSnowLeopard()) { 87 if (!CheckSnowLeopard()) {
89 return; 88 return;
90 } 89 }
91 90
92 EXPECT_CALL(delegate_, OnCaptureCompleted(_)) 91 EXPECT_CALL(delegate_, OnCaptureCompleted(_))
93 .Times(2) 92 .Times(2)
94 .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback1)) 93 .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback1))
95 .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback2)); 94 .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback2));
96 EXPECT_CALL(delegate_, OnCursorShapeChangedPtr(_)) 95 EXPECT_CALL(delegate_, OnCursorShapeChanged(_))
97 .Times(AnyNumber()); 96 .Times(AnyNumber());
98 97
99 SCOPED_TRACE(""); 98 SCOPED_TRACE("");
100 capturer_->Start(&delegate_); 99 capturer_->Start(&delegate_);
101 100
102 // Check that we get an initial full-screen updated. 101 // Check that we get an initial full-screen updated.
103 capturer_->CaptureFrame(); 102 capturer_->CaptureFrame();
104 103
105 // Check that subsequent dirty rects are propagated correctly. 104 // Check that subsequent dirty rects are propagated correctly.
106 AddDirtyRect(); 105 AddDirtyRect();
(...skipping 11 matching lines...) Expand all
118 for (SkRegion::Iterator i(region); !i.done(); i.next()) { 117 for (SkRegion::Iterator i(region); !i.done(); i.next()) {
119 const SkIRect& r = i.rect(); 118 const SkIRect& r = i.rect();
120 out << "(" << r.fLeft << "," << r.fTop << "," 119 out << "(" << r.fLeft << "," << r.fTop << ","
121 << r.fRight << "," << r.fBottom << ")"; 120 << r.fRight << "," << r.fBottom << ")";
122 } 121 }
123 out << ")"; 122 out << ")";
124 return out; 123 return out;
125 } 124 }
126 125
127 } // namespace gfx 126 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698