| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return new CountedBrowserAccessibility(); | 60 return new CountedBrowserAccessibility(); |
| 61 } | 61 } |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class TestBrowserAccessibilityDelegate | 64 class TestBrowserAccessibilityDelegate |
| 65 : public BrowserAccessibilityDelegate { | 65 : public BrowserAccessibilityDelegate { |
| 66 public: | 66 public: |
| 67 TestBrowserAccessibilityDelegate() | 67 TestBrowserAccessibilityDelegate() |
| 68 : got_fatal_error_(false) {} | 68 : got_fatal_error_(false) {} |
| 69 | 69 |
| 70 void AccessibilitySetFocus(int acc_obj_id) override {} | 70 void AccessibilityPerformAction(const ui::AXActionData& data) override {} |
| 71 void AccessibilityDoDefaultAction(int acc_obj_id) override {} | |
| 72 void AccessibilityShowContextMenu(int acc_obj_id) override {} | |
| 73 void AccessibilityScrollToMakeVisible(int acc_obj_id, | |
| 74 const gfx::Rect& subfocus) override {} | |
| 75 void AccessibilityScrollToPoint(int acc_obj_id, | |
| 76 const gfx::Point& point) override {} | |
| 77 void AccessibilitySetScrollOffset(int acc_obj_id, | |
| 78 const gfx::Point& offset) override {} | |
| 79 void AccessibilitySetSelection(int acc_anchor_obj_id, | |
| 80 int start_offset, | |
| 81 int acc_focus_obj_id, | |
| 82 int end_offset) override {} | |
| 83 void AccessibilitySetValue(int acc_obj_id, const base::string16& value) | |
| 84 override {} | |
| 85 bool AccessibilityViewHasFocus() const override { return false; } | 71 bool AccessibilityViewHasFocus() const override { return false; } |
| 86 gfx::Rect AccessibilityGetViewBounds() const override { return gfx::Rect(); } | 72 gfx::Rect AccessibilityGetViewBounds() const override { return gfx::Rect(); } |
| 87 gfx::Point AccessibilityOriginInScreen( | 73 gfx::Point AccessibilityOriginInScreen( |
| 88 const gfx::Rect& bounds) const override { | 74 const gfx::Rect& bounds) const override { |
| 89 return gfx::Point(); | 75 return gfx::Point(); |
| 90 } | 76 } |
| 91 void AccessibilityHitTest(const gfx::Point& point) override {} | |
| 92 void AccessibilitySetAccessibilityFocus(int acc_obj_id) override {} | |
| 93 void AccessibilityFatalError() override { got_fatal_error_ = true; } | 77 void AccessibilityFatalError() override { got_fatal_error_ = true; } |
| 94 gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override { | 78 gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override { |
| 95 return gfx::kNullAcceleratedWidget; | 79 return gfx::kNullAcceleratedWidget; |
| 96 } | 80 } |
| 97 gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() override { | 81 gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() override { |
| 98 return nullptr; | 82 return nullptr; |
| 99 } | 83 } |
| 100 | 84 |
| 101 bool got_fatal_error() const { return got_fatal_error_; } | 85 bool got_fatal_error() const { return got_fatal_error_; } |
| 102 void reset_got_fatal_error() { got_fatal_error_ = false; } | 86 void reset_got_fatal_error() { got_fatal_error_ = false; } |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 4, ui::FORWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_DOWNSTREAM)); | 1648 4, ui::FORWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_DOWNSTREAM)); |
| 1665 | 1649 |
| 1666 // If the affinity is upstream, check that we get the second line. | 1650 // If the affinity is upstream, check that we get the second line. |
| 1667 ASSERT_EQ(0, static_text_accessible->GetLineStartBoundary( | 1651 ASSERT_EQ(0, static_text_accessible->GetLineStartBoundary( |
| 1668 4, ui::BACKWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_UPSTREAM)); | 1652 4, ui::BACKWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_UPSTREAM)); |
| 1669 ASSERT_EQ(4, static_text_accessible->GetLineStartBoundary( | 1653 ASSERT_EQ(4, static_text_accessible->GetLineStartBoundary( |
| 1670 4, ui::FORWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_UPSTREAM)); | 1654 4, ui::FORWARDS_DIRECTION, ui::AX_TEXT_AFFINITY_UPSTREAM)); |
| 1671 } | 1655 } |
| 1672 | 1656 |
| 1673 } // namespace content | 1657 } // namespace content |
| OLD | NEW |