Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: content/browser/accessibility/site_per_process_accessibility_browsertest.cc

Issue 848653002: Re-land: Send Windows accessibility events based on tree updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@implicit_1_tests
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 ASSERT_EQ(1U, ax_iframe->PlatformChildCount()); 140 ASSERT_EQ(1U, ax_iframe->PlatformChildCount());
140 141
141 BrowserAccessibility* ax_scroll_area = ax_iframe->PlatformGetChild(0); 142 BrowserAccessibility* ax_scroll_area = ax_iframe->PlatformGetChild(0);
142 EXPECT_EQ(ui::AX_ROLE_SCROLL_AREA, ax_scroll_area->GetRole()); 143 EXPECT_EQ(ui::AX_ROLE_SCROLL_AREA, ax_scroll_area->GetRole());
143 ASSERT_EQ(1U, ax_scroll_area->PlatformChildCount()); 144 ASSERT_EQ(1U, ax_scroll_area->PlatformChildCount());
144 145
145 BrowserAccessibility* ax_child_frame_root = 146 BrowserAccessibility* ax_child_frame_root =
146 ax_scroll_area->PlatformGetChild(0); 147 ax_scroll_area->PlatformGetChild(0);
147 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, ax_child_frame_root->GetRole()); 148 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, ax_child_frame_root->GetRole());
148 ASSERT_EQ(1U, ax_child_frame_root->PlatformChildCount()); 149 ASSERT_EQ(1U, ax_child_frame_root->PlatformChildCount());
149 EXPECT_EQ("Title Of Awesomeness", ax_child_frame_root->name()); 150 EXPECT_EQ("Title Of Awesomeness",
151 ax_child_frame_root->GetStringAttribute(ui::AX_ATTR_NAME));
150 152
151 BrowserAccessibility* ax_child_frame_group = 153 BrowserAccessibility* ax_child_frame_group =
152 ax_child_frame_root->PlatformGetChild(0); 154 ax_child_frame_root->PlatformGetChild(0);
153 EXPECT_EQ(ui::AX_ROLE_GROUP, ax_child_frame_group->GetRole()); 155 EXPECT_EQ(ui::AX_ROLE_GROUP, ax_child_frame_group->GetRole());
154 ASSERT_EQ(1U, ax_child_frame_group->PlatformChildCount()); 156 ASSERT_EQ(1U, ax_child_frame_group->PlatformChildCount());
155 157
156 BrowserAccessibility* ax_child_frame_static_text = 158 BrowserAccessibility* ax_child_frame_static_text =
157 ax_child_frame_group->PlatformGetChild(0); 159 ax_child_frame_group->PlatformGetChild(0);
158 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); 160 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole());
159 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); 161 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount());
160 162
161 // Last, check that the parent of the child frame root is correct. 163 // Last, check that the parent of the child frame root is correct.
162 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); 164 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area);
163 } 165 }
164 166
165 } // namespace content 167 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698