| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 base::Bind(&AccessibilityHighlightManagerTest::GotSnapshot, this)); | 131 base::Bind(&AccessibilityHighlightManagerTest::GotSnapshot, this)); |
| 132 base::RunLoop run_loop; | 132 base::RunLoop run_loop; |
| 133 run_loop_quitter_ = run_loop.QuitClosure(); | 133 run_loop_quitter_ = run_loop.QuitClosure(); |
| 134 run_loop.Run(); | 134 run_loop.Run(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 base::Closure run_loop_quitter_; | 137 base::Closure run_loop_quitter_; |
| 138 gfx::Image image_; | 138 gfx::Image image_; |
| 139 SkBitmap before_bmp_; | 139 SkBitmap before_bmp_; |
| 140 SkBitmap after_bmp_; | 140 SkBitmap after_bmp_; |
| 141 int diff_count_; | 141 int diff_count_ = 0; |
| 142 SkColor average_diff_color_; | 142 SkColor average_diff_color_ = 0; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManagerTest); | 144 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManagerTest); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 IN_PROC_BROWSER_TEST_F(AccessibilityHighlightManagerTest, | 147 IN_PROC_BROWSER_TEST_F(AccessibilityHighlightManagerTest, |
| 148 TestCaretRingDrawsBluePixels) { | 148 TestCaretRingDrawsBluePixels) { |
| 149 gfx::Rect capture_bounds(200, 300, 100, 100); | 149 gfx::Rect capture_bounds(200, 300, 100, 100); |
| 150 gfx::Rect caret_bounds(230, 330, 1, 25); | 150 gfx::Rect caret_bounds(230, 330, 1, 25); |
| 151 | 151 |
| 152 CaptureBeforeImage(capture_bounds); | 152 CaptureBeforeImage(capture_bounds); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // This is a smoke test to assert that something is drawn in the right | 212 // This is a smoke test to assert that something is drawn in the right |
| 213 // part of the screen of approximately the right size and color. | 213 // part of the screen of approximately the right size and color. |
| 214 // There's deliberately some tolerance for tiny errors. | 214 // There's deliberately some tolerance for tiny errors. |
| 215 EXPECT_NEAR(1608, diff_count(), 50); | 215 EXPECT_NEAR(1608, diff_count(), 50); |
| 216 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); | 216 EXPECT_NEAR(255, SkColorGetR(average_diff_color()), 5); |
| 217 EXPECT_NEAR(201, SkColorGetG(average_diff_color()), 5); | 217 EXPECT_NEAR(201, SkColorGetG(average_diff_color()), 5); |
| 218 EXPECT_NEAR(152, SkColorGetB(average_diff_color()), 5); | 218 EXPECT_NEAR(152, SkColorGetB(average_diff_color()), 5); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace chromeos | 221 } // namespace chromeos |
| OLD | NEW |