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

Side by Side Diff: remoting/host/screen_recorder_unittest.cc

Issue 10382184: [Chromoting] Initial plumbing for cursor shape. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Call SetCursor only for native format images Created 8 years, 7 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 | 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/screen_recorder.h" 5 #include "remoting/host/screen_recorder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "remoting/base/base_mock_objects.h" 9 #include "remoting/base/base_mock_objects.h"
10 #include "remoting/host/host_mock_objects.h" 10 #include "remoting/host/host_mock_objects.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // ScreenRecorder is instructed to come to a complete stop. We expect the stop 120 // ScreenRecorder is instructed to come to a complete stop. We expect the stop
121 // sequence to be executed successfully. 121 // sequence to be executed successfully.
122 TEST_F(ScreenRecorderTest, StartAndStop) { 122 TEST_F(ScreenRecorderTest, StartAndStop) {
123 SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10)); 123 SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10));
124 DataPlanes planes; 124 DataPlanes planes;
125 for (int i = 0; i < DataPlanes::kPlaneCount; ++i) { 125 for (int i = 0; i < DataPlanes::kPlaneCount; ++i) {
126 planes.data[i] = reinterpret_cast<uint8*>(i); 126 planes.data[i] = reinterpret_cast<uint8*>(i);
127 planes.strides[i] = kWidth * 4; 127 planes.strides[i] = kWidth * 4;
128 } 128 }
129 129
130 Expectation capturer_start = EXPECT_CALL(capturer_, Start()); 130 Expectation capturer_start = EXPECT_CALL(capturer_, Start(_));
131 131
132 SkISize size(SkISize::Make(kWidth, kHeight)); 132 SkISize size(SkISize::Make(kWidth, kHeight));
133 scoped_refptr<CaptureData> data(new CaptureData(planes, size, kFormat)); 133 scoped_refptr<CaptureData> data(new CaptureData(planes, size, kFormat));
134 EXPECT_CALL(capturer_, InvalidateFullScreen()); 134 EXPECT_CALL(capturer_, InvalidateFullScreen());
135 135
136 // First the capturer is called. 136 // First the capturer is called.
137 Expectation capturer_capture = EXPECT_CALL(capturer_, CaptureInvalidRegion(_)) 137 Expectation capturer_capture = EXPECT_CALL(capturer_, CaptureInvalidRegion(_))
138 .After(capturer_start) 138 .After(capturer_start)
139 .WillRepeatedly(RunCallback(update_region, data)); 139 .WillRepeatedly(RunCallback(update_region, data));
140 140
(...skipping 28 matching lines...) Expand all
169 record_->Start(); 169 record_->Start();
170 message_loop_.Run(); 170 message_loop_.Run();
171 } 171 }
172 172
173 TEST_F(ScreenRecorderTest, StopWithoutStart) { 173 TEST_F(ScreenRecorderTest, StopWithoutStart) {
174 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); 174 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_));
175 message_loop_.Run(); 175 message_loop_.Run();
176 } 176 }
177 177
178 } // namespace remoting 178 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698