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

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

Issue 407493004: Revert of Revert of Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "content/browser/accessibility/accessibility_tree_formatter.h" 17 #include "content/browser/accessibility/accessibility_tree_formatter.h"
18 #include "content/browser/accessibility/browser_accessibility.h" 18 #include "content/browser/accessibility/browser_accessibility.h"
19 #include "content/browser/accessibility/browser_accessibility_manager.h" 19 #include "content/browser/accessibility/browser_accessibility_manager.h"
20 #include "content/browser/renderer_host/render_view_host_impl.h" 20 #include "content/browser/renderer_host/render_view_host_impl.h"
21 #include "content/browser/renderer_host/render_widget_host_view_base.h" 21 #include "content/browser/renderer_host/render_widget_host_view_base.h"
22 #include "content/browser/web_contents/web_contents_impl.h"
22 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
23 #include "content/public/common/content_paths.h" 24 #include "content/public/common/content_paths.h"
24 #include "content/public/common/content_switches.h" 25 #include "content/public/common/content_switches.h"
25 #include "content/public/common/url_constants.h" 26 #include "content/public/common/url_constants.h"
26 #include "content/public/test/content_browser_test.h" 27 #include "content/public/test/content_browser_test.h"
27 #include "content/public/test/content_browser_test_utils.h" 28 #include "content/public/test/content_browser_test_utils.h"
28 #include "content/shell/browser/shell.h" 29 #include "content/shell/browser/shell.h"
29 #include "content/test/accessibility_browser_test_utils.h" 30 #include "content/test/accessibility_browser_test_utils.h"
30 #include "testing/gtest/include/gtest/gtest.h" 31 #include "testing/gtest/include/gtest/gtest.h"
31 32
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 base::string16 html_contents16; 175 base::string16 html_contents16;
175 html_contents16 = base::UTF8ToUTF16(html_contents); 176 html_contents16 = base::UTF8ToUTF16(html_contents);
176 GURL url = GetTestUrl("accessibility", 177 GURL url = GetTestUrl("accessibility",
177 html_file.BaseName().MaybeAsASCII().c_str()); 178 html_file.BaseName().MaybeAsASCII().c_str());
178 AccessibilityNotificationWaiter waiter( 179 AccessibilityNotificationWaiter waiter(
179 shell(), AccessibilityModeComplete, 180 shell(), AccessibilityModeComplete,
180 ui::AX_EVENT_LOAD_COMPLETE); 181 ui::AX_EVENT_LOAD_COMPLETE);
181 NavigateToURL(shell(), url); 182 NavigateToURL(shell(), url);
182 waiter.WaitForNotification(); 183 waiter.WaitForNotification();
183 184
184 RenderWidgetHostViewBase* host_view = static_cast<RenderWidgetHostViewBase*>( 185 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
185 shell()->web_contents()->GetRenderWidgetHostView()); 186 shell()->web_contents());
186 AccessibilityTreeFormatter formatter( 187 AccessibilityTreeFormatter formatter(
187 host_view->GetBrowserAccessibilityManager()->GetRoot()); 188 web_contents->GetRootBrowserAccessibilityManager()->GetRoot());
188 189
189 // Parse filters in the test file. 190 // Parse filters in the test file.
190 std::vector<Filter> filters; 191 std::vector<Filter> filters;
191 AddDefaultFilters(&filters); 192 AddDefaultFilters(&filters);
192 ParseFilters(html_contents, &filters); 193 ParseFilters(html_contents, &filters);
193 formatter.SetFilters(filters); 194 formatter.SetFilters(filters);
194 195
195 // Perform a diff (or write the initial baseline). 196 // Perform a diff (or write the initial baseline).
196 base::string16 actual_contents_utf16; 197 base::string16 actual_contents_utf16;
197 formatter.FormatAccessibilityTree(&actual_contents_utf16); 198 formatter.FormatAccessibilityTree(&actual_contents_utf16);
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { 543 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) {
543 RunTest(FILE_PATH_LITERAL("wbr.html")); 544 RunTest(FILE_PATH_LITERAL("wbr.html"));
544 } 545 }
545 546
546 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 547 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
547 AccessibilityAriaActivedescendant) { 548 AccessibilityAriaActivedescendant) {
548 RunTest(FILE_PATH_LITERAL("aria-activedescendant.html")); 549 RunTest(FILE_PATH_LITERAL("aria-activedescendant.html"));
549 } 550 }
550 551
551 } // namespace content 552 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_state_impl.cc ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698