OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" |
7 #include "content/browser/accessibility/browser_accessibility.h" | 8 #include "content/browser/accessibility/browser_accessibility.h" |
8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 9 #include "content/browser/accessibility/browser_accessibility_manager.h" |
9 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
10 #include "content/browser/frame_host/cross_process_frame_connector.h" | 11 #include "content/browser/frame_host/cross_process_frame_connector.h" |
11 #include "content/browser/frame_host/frame_tree.h" | 12 #include "content/browser/frame_host/frame_tree.h" |
12 #include "content/browser/frame_host/render_frame_proxy_host.h" | 13 #include "content/browser/frame_host/render_frame_proxy_host.h" |
13 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 14 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
14 #include "content/browser/renderer_host/render_view_host_impl.h" | 15 #include "content/browser/renderer_host/render_view_host_impl.h" |
15 #include "content/browser/site_per_process_browsertest.h" | 16 #include "content/browser/site_per_process_browsertest.h" |
16 #include "content/browser/web_contents/web_contents_impl.h" | 17 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ASSERT_EQ(1U, ax_iframe->PlatformChildCount()); | 121 ASSERT_EQ(1U, ax_iframe->PlatformChildCount()); |
121 | 122 |
122 BrowserAccessibility* ax_scroll_area = ax_iframe->PlatformGetChild(0); | 123 BrowserAccessibility* ax_scroll_area = ax_iframe->PlatformGetChild(0); |
123 ASSERT_EQ(ui::AX_ROLE_SCROLL_AREA, ax_scroll_area->GetRole()); | 124 ASSERT_EQ(ui::AX_ROLE_SCROLL_AREA, ax_scroll_area->GetRole()); |
124 ASSERT_EQ(1U, ax_scroll_area->PlatformChildCount()); | 125 ASSERT_EQ(1U, ax_scroll_area->PlatformChildCount()); |
125 | 126 |
126 BrowserAccessibility* ax_child_frame_root = | 127 BrowserAccessibility* ax_child_frame_root = |
127 ax_scroll_area->PlatformGetChild(0); | 128 ax_scroll_area->PlatformGetChild(0); |
128 ASSERT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, ax_child_frame_root->GetRole()); | 129 ASSERT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, ax_child_frame_root->GetRole()); |
129 ASSERT_EQ(1U, ax_child_frame_root->PlatformChildCount()); | 130 ASSERT_EQ(1U, ax_child_frame_root->PlatformChildCount()); |
130 ASSERT_EQ("Title Of Awesomeness", ax_child_frame_root->name()); | 131 ASSERT_EQ("Title Of Awesomeness", |
| 132 ax_child_frame_root->GetStringAttribute(ui::AX_ATTR_NAME)); |
131 | 133 |
132 BrowserAccessibility* ax_child_frame_group = | 134 BrowserAccessibility* ax_child_frame_group = |
133 ax_child_frame_root->PlatformGetChild(0); | 135 ax_child_frame_root->PlatformGetChild(0); |
134 ASSERT_EQ(ui::AX_ROLE_GROUP, ax_child_frame_group->GetRole()); | 136 ASSERT_EQ(ui::AX_ROLE_GROUP, ax_child_frame_group->GetRole()); |
135 ASSERT_EQ(1U, ax_child_frame_group->PlatformChildCount()); | 137 ASSERT_EQ(1U, ax_child_frame_group->PlatformChildCount()); |
136 | 138 |
137 BrowserAccessibility* ax_child_frame_static_text = | 139 BrowserAccessibility* ax_child_frame_static_text = |
138 ax_child_frame_group->PlatformGetChild(0); | 140 ax_child_frame_group->PlatformGetChild(0); |
139 ASSERT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); | 141 ASSERT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); |
140 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); | 142 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); |
141 | 143 |
142 // Last, check that the parent of the child frame root is correct. | 144 // Last, check that the parent of the child frame root is correct. |
143 ASSERT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); | 145 ASSERT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); |
144 } | 146 } |
145 | 147 |
146 } // namespace content | 148 } // namespace content |
OLD | NEW |