| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 IN_PROC_BROWSER_TEST_F(AccessibilityHighlightManagerTest, | 190 IN_PROC_BROWSER_TEST_F(AccessibilityHighlightManagerTest, |
| 191 TestCursorRingDrawsRedPixels) { | 191 TestCursorRingDrawsRedPixels) { |
| 192 gfx::Rect capture_bounds(200, 300, 100, 100); | 192 gfx::Rect capture_bounds(200, 300, 100, 100); |
| 193 gfx::Point cursor_point(250, 350); | 193 gfx::Point cursor_point(250, 350); |
| 194 | 194 |
| 195 CaptureBeforeImage(capture_bounds); | 195 CaptureBeforeImage(capture_bounds); |
| 196 | 196 |
| 197 TestAccessibilityHighlightManager manager; | 197 TestAccessibilityHighlightManager manager; |
| 198 manager.HighlightCursor(true); | 198 manager.HighlightCursor(true); |
| 199 ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, cursor_point, cursor_point, | 199 ui::MouseEvent mouse_move( |
| 200 ui::EventTimeForNow(), 0, 0); | 200 ui::ET_MOUSE_MOVED, cursor_point, cursor_point, ui::EventTimeForNow(), 0, |
| 201 0, ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 201 manager.OnMouseEvent(&mouse_move); | 202 manager.OnMouseEvent(&mouse_move); |
| 202 CaptureAfterImage(capture_bounds); | 203 CaptureAfterImage(capture_bounds); |
| 203 ComputeImageStats(); | 204 ComputeImageStats(); |
| 204 | 205 |
| 205 // This is a smoke test to assert that something is drawn in the right | 206 // This is a smoke test to assert that something is drawn in the right |
| 206 // part of the screen of approximately the right size and color. | 207 // part of the screen of approximately the right size and color. |
| 207 // There's deliberately some tolerance for tiny errors. | 208 // There's deliberately some tolerance for tiny errors. |
| 208 EXPECT_NEAR(1521, diff_count(), 50); | 209 EXPECT_NEAR(1521, diff_count(), 50); |
| 209 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); | 210 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); |
| 210 EXPECT_NEAR(176, SkColorGetG(average_diff_color()), 5); | 211 EXPECT_NEAR(176, SkColorGetG(average_diff_color()), 5); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 230 // This is a smoke test to assert that something is drawn in the right | 231 // This is a smoke test to assert that something is drawn in the right |
| 231 // part of the screen of approximately the right size and color. | 232 // part of the screen of approximately the right size and color. |
| 232 // There's deliberately some tolerance for tiny errors. | 233 // There's deliberately some tolerance for tiny errors. |
| 233 EXPECT_NEAR(1608, diff_count(), 50); | 234 EXPECT_NEAR(1608, diff_count(), 50); |
| 234 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); | 235 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); |
| 235 EXPECT_NEAR(201, SkColorGetG(average_diff_color()), 5); | 236 EXPECT_NEAR(201, SkColorGetG(average_diff_color()), 5); |
| 236 EXPECT_NEAR(152, SkColorGetB(average_diff_color()), 5); | 237 EXPECT_NEAR(152, SkColorGetB(average_diff_color()), 5); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace chromeos | 240 } // namespace chromeos |
| OLD | NEW |