OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ui/accessibility_focus_ring_controller.h" | 5 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace chromeos { | 9 namespace chromeos { |
10 | 10 |
11 class TestableAccessibilityFocusRingController | 11 class TestableAccessibilityFocusRingController |
12 : public AccessibilityFocusRingController { | 12 : public AccessibilityFocusRingController { |
13 public: | 13 public: |
14 TestableAccessibilityFocusRingController() { | 14 TestableAccessibilityFocusRingController() { |
15 // By default use an easy round number for testing. | 15 // By default use an easy round number for testing. |
16 margin_ = 10; | 16 margin_ = 10; |
17 } | 17 } |
18 virtual ~TestableAccessibilityFocusRingController() {} | 18 virtual ~TestableAccessibilityFocusRingController() {} |
19 | 19 |
20 void RectsToRings(const std::vector<gfx::Rect>& rects, | 20 void RectsToRings(const std::vector<gfx::Rect>& rects, |
21 std::vector<AccessibilityFocusRing>* rings) const { | 21 std::vector<AccessibilityFocusRing>* rings) const { |
22 AccessibilityFocusRingController::RectsToRings(rects, rings); | 22 AccessibilityFocusRingController::RectsToRings(rects, rings); |
23 } | 23 } |
24 | 24 |
25 virtual int GetMargin() const OVERRIDE { | 25 virtual int GetMargin() const override { |
26 return margin_; | 26 return margin_; |
27 } | 27 } |
28 | 28 |
29 private: | 29 private: |
30 int margin_; | 30 int margin_; |
31 }; | 31 }; |
32 | 32 |
33 class AccessibilityFocusRingControllerTest : public testing::Test { | 33 class AccessibilityFocusRingControllerTest : public testing::Test { |
34 public: | 34 public: |
35 AccessibilityFocusRingControllerTest() {} | 35 AccessibilityFocusRingControllerTest() {} |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 EXPECT_EQ(gfx::Point(0, 400), points[29]); | 124 EXPECT_EQ(gfx::Point(0, 400), points[29]); |
125 EXPECT_EQ(gfx::Point(0, 390), points[30]); | 125 EXPECT_EQ(gfx::Point(0, 390), points[30]); |
126 EXPECT_EQ(gfx::Point(0, 110), points[31]); | 126 EXPECT_EQ(gfx::Point(0, 110), points[31]); |
127 EXPECT_EQ(gfx::Point(0, 100), points[32]); | 127 EXPECT_EQ(gfx::Point(0, 100), points[32]); |
128 EXPECT_EQ(gfx::Point(0, 100), points[33]); | 128 EXPECT_EQ(gfx::Point(0, 100), points[33]); |
129 EXPECT_EQ(gfx::Point(0, 100), points[34]); | 129 EXPECT_EQ(gfx::Point(0, 100), points[34]); |
130 EXPECT_EQ(gfx::Point(0, 100), points[35]); | 130 EXPECT_EQ(gfx::Point(0, 100), points[35]); |
131 } | 131 } |
132 | 132 |
133 } // namespace chromeos | 133 } // namespace chromeos |
OLD | NEW |