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

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: Use ClientStub instead of CursorShapeStub Created 8 years, 6 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // ScreenRecorder is instructed to come to a complete stop. We expect the stop 121 // ScreenRecorder is instructed to come to a complete stop. We expect the stop
122 // sequence to be executed successfully. 122 // sequence to be executed successfully.
123 TEST_F(ScreenRecorderTest, StartAndStop) { 123 TEST_F(ScreenRecorderTest, StartAndStop) {
124 SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10)); 124 SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10));
125 DataPlanes planes; 125 DataPlanes planes;
126 for (int i = 0; i < DataPlanes::kPlaneCount; ++i) { 126 for (int i = 0; i < DataPlanes::kPlaneCount; ++i) {
127 planes.data[i] = reinterpret_cast<uint8*>(i); 127 planes.data[i] = reinterpret_cast<uint8*>(i);
128 planes.strides[i] = kWidth * 4; 128 planes.strides[i] = kWidth * 4;
129 } 129 }
130 130
131 Expectation capturer_start = EXPECT_CALL(capturer_, Start()); 131 Expectation capturer_start = EXPECT_CALL(capturer_, Start(_));
132 132
133 SkISize size(SkISize::Make(kWidth, kHeight)); 133 SkISize size(SkISize::Make(kWidth, kHeight));
134 scoped_refptr<CaptureData> data(new CaptureData(planes, size, kFormat)); 134 scoped_refptr<CaptureData> data(new CaptureData(planes, size, kFormat));
135 EXPECT_CALL(capturer_, InvalidateFullScreen()); 135 EXPECT_CALL(capturer_, InvalidateFullScreen());
136 136
137 // First the capturer is called. 137 // First the capturer is called.
138 Expectation capturer_capture = EXPECT_CALL(capturer_, CaptureInvalidRegion(_)) 138 Expectation capturer_capture = EXPECT_CALL(capturer_, CaptureInvalidRegion(_))
139 .After(capturer_start) 139 .After(capturer_start)
140 .WillRepeatedly(RunCallback(update_region, data)); 140 .WillRepeatedly(RunCallback(update_region, data));
141 141
(...skipping 29 matching lines...) Expand all
171 message_loop_.Run(); 171 message_loop_.Run();
172 } 172 }
173 173
174 TEST_F(ScreenRecorderTest, StopWithoutStart) { 174 TEST_F(ScreenRecorderTest, StopWithoutStart) {
175 EXPECT_CALL(capturer_, Stop()); 175 EXPECT_CALL(capturer_, Stop());
176 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); 176 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_));
177 message_loop_.Run(); 177 message_loop_.Run();
178 } 178 }
179 179
180 } // namespace remoting 180 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698