OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "modules/accessibility/AXObject.h" | 5 #include "modules/accessibility/AXObjectImpl.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/testing/DummyPageHolder.h" | 9 #include "core/testing/DummyPageHolder.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class AXObjectTest : public testing::Test { | 15 class AXObjectTest : public testing::Test { |
(...skipping 25 matching lines...) Expand all Loading... |
41 "<span id=\"haspopup\" " | 41 "<span id=\"haspopup\" " |
42 "aria-haspopup=\"true\">aria-haspopup-true</span><br>" | 42 "aria-haspopup=\"true\">aria-haspopup-true</span><br>" |
43 "<div id=\"focusable\" tabindex=\"1\">focusable</div><br>" | 43 "<div id=\"focusable\" tabindex=\"1\">focusable</div><br>" |
44 "<div tabindex=\"2\"><div " | 44 "<div tabindex=\"2\"><div " |
45 "id=\"focusable-parent\">focusable-parent</div></div><br>" | 45 "id=\"focusable-parent\">focusable-parent</div></div><br>" |
46 "</body>"; | 46 "</body>"; |
47 | 47 |
48 GetDocument().documentElement()->setInnerHTML(test_content); | 48 GetDocument().documentElement()->setInnerHTML(test_content); |
49 GetDocument().UpdateStyleAndLayout(); | 49 GetDocument().UpdateStyleAndLayout(); |
50 Element* root(GetDocument().documentElement()); | 50 Element* root(GetDocument().documentElement()); |
51 EXPECT_FALSE(AXObject::IsInsideFocusableElementOrARIAWidget( | 51 EXPECT_FALSE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
52 *root->getElementById("plain"))); | 52 *root->getElementById("plain"))); |
53 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 53 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
54 *root->getElementById("button"))); | 54 *root->getElementById("button"))); |
55 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 55 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
56 *root->getElementById("button-parent"))); | 56 *root->getElementById("button-parent"))); |
57 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 57 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
58 *root->getElementById("button-caps"))); | 58 *root->getElementById("button-caps"))); |
59 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 59 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
60 *root->getElementById("button-second"))); | 60 *root->getElementById("button-second"))); |
61 EXPECT_FALSE(AXObject::IsInsideFocusableElementOrARIAWidget( | 61 EXPECT_FALSE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
62 *root->getElementById("aria-bogus"))); | 62 *root->getElementById("aria-bogus"))); |
63 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 63 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
64 *root->getElementById("aria-selected"))); | 64 *root->getElementById("aria-selected"))); |
65 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 65 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
66 *root->getElementById("haspopup"))); | 66 *root->getElementById("haspopup"))); |
67 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 67 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
68 *root->getElementById("focusable"))); | 68 *root->getElementById("focusable"))); |
69 EXPECT_TRUE(AXObject::IsInsideFocusableElementOrARIAWidget( | 69 EXPECT_TRUE(AXObjectImpl::IsInsideFocusableElementOrARIAWidget( |
70 *root->getElementById("focusable-parent"))); | 70 *root->getElementById("focusable-parent"))); |
71 } | 71 } |
72 | 72 |
73 } // namespace blink | 73 } // namespace blink |
OLD | NEW |