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

Side by Side Diff: content/browser/media/capture/cursor_renderer_aura_unittest.cc

Issue 1760063004: Add a test case for cursor display on root window (screen share). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "content/browser/media/capture/cursor_renderer_aura.h" 5 #include "content/browser/media/capture/cursor_renderer_aura.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 MoveMouseCursorWithinWindow(gfx::Point(60, 60)); 194 MoveMouseCursorWithinWindow(gfx::Point(60, 60));
195 SnapshotCursorState(gfx::Rect(size)); 195 SnapshotCursorState(gfx::Rect(size));
196 EXPECT_TRUE(CursorDisplayed()); 196 EXPECT_TRUE(CursorDisplayed());
197 197
198 EXPECT_FALSE(NonZeroPixelsInRegion(frame, gfx::Rect(50, 50, 70, 70))); 198 EXPECT_FALSE(NonZeroPixelsInRegion(frame, gfx::Rect(50, 50, 70, 70)));
199 RenderCursorOnVideoFrame(frame); 199 RenderCursorOnVideoFrame(frame);
200 EXPECT_TRUE(NonZeroPixelsInRegion(frame, gfx::Rect(50, 50, 70, 70))); 200 EXPECT_TRUE(NonZeroPixelsInRegion(frame, gfx::Rect(50, 50, 70, 70)));
201 } 201 }
202 202
203 TEST_F(CursorRendererAuraTest, CursorRenderedOnRootWindow) {
204 cursor_renderer_.reset(new CursorRendererAura(root_window()));
205 EXPECT_FALSE(CursorDisplayed());
206
207 // Cursor displayed after mouse movement.
208 MoveMouseCursorWithinWindow();
209 EXPECT_TRUE(CursorDisplayed());
210
211 // Cursor being displayed even if another window is activated.
212 scoped_ptr<aura::Window> window2(aura::test::CreateTestWindowWithBounds(
213 gfx::Rect(0, 0, 800, 600), root_window()));
214 wm::ActivateWindow(window2.get());
215 SnapshotCursorState(gfx::Rect(0, 0, 800, 600));
216 EXPECT_TRUE(CursorDisplayed());
217 }
218
203 } // namespace content 219 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698