| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |