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

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

Issue 999193003: Add RoutingIDIssuer to help track routing id issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 "base/strings/utf_string_conversions.h"
8 #include "content/browser/accessibility/browser_accessibility.h" 8 #include "content/browser/accessibility/browser_accessibility.h"
9 #include "content/browser/accessibility/browser_accessibility_manager.h" 9 #include "content/browser/accessibility/browser_accessibility_manager.h"
10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
11 #include "content/browser/frame_host/cross_process_frame_connector.h" 11 #include "content/browser/frame_host/cross_process_frame_connector.h"
12 #include "content/browser/frame_host/frame_tree.h" 12 #include "content/browser/frame_host/frame_tree.h"
13 #include "content/browser/frame_host/render_frame_proxy_host.h" 13 #include "content/browser/frame_host/render_frame_proxy_host.h"
14 #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"
15 #include "content/browser/renderer_host/render_view_host_impl.h" 15 #include "content/browser/renderer_host/render_view_host_impl.h"
16 #include "content/browser/site_per_process_browsertest.h" 16 #include "content/browser/site_per_process_browsertest.h"
17 #include "content/browser/web_contents/web_contents_impl.h" 17 #include "content/browser/web_contents/web_contents_impl.h"
18 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
20 #include "content/public/browser/notification_types.h" 20 #include "content/public/browser/notification_types.h"
21 #include "content/public/browser/web_contents_observer.h" 21 #include "content/public/browser/web_contents_observer.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/test/browser_test_utils.h" 23 #include "content/public/test/browser_test_utils.h"
24 #include "content/public/test/content_browser_test.h" 24 #include "content/public/test/content_browser_test.h"
25 #include "content/public/test/content_browser_test_utils.h" 25 #include "content/public/test/content_browser_test_utils.h"
26 #include "content/public/test/routing_id_mangling_disabler.h"
26 #include "content/public/test/test_utils.h" 27 #include "content/public/test/test_utils.h"
27 #include "content/shell/browser/shell.h" 28 #include "content/shell/browser/shell.h"
28 #include "content/test/accessibility_browser_test_utils.h" 29 #include "content/test/accessibility_browser_test_utils.h"
29 #include "content/test/content_browser_test_utils_internal.h" 30 #include "content/test/content_browser_test_utils_internal.h"
30 #include "net/dns/mock_host_resolver.h" 31 #include "net/dns/mock_host_resolver.h"
31 #include "url/gurl.h" 32 #include "url/gurl.h"
32 #include "url/url_constants.h" 33 #include "url/url_constants.h"
33 34
34 namespace content { 35 namespace content {
35 36
36 class SitePerProcessAccessibilityBrowserTest 37 class SitePerProcessAccessibilityBrowserTest
37 : public SitePerProcessBrowserTest { 38 : public SitePerProcessBrowserTest {
38 public: 39 public:
39 SitePerProcessAccessibilityBrowserTest() {} 40 SitePerProcessAccessibilityBrowserTest() {}
41
42 // TODO(morrita): This is fishy. This test shouldn't rely on the
43 // abasence of routing_id mangling. Something seems wrong.
44 // See http://crbug.com/422136 for more updates.
45 content::RoutingIDManglingDisabler mangling_disabler_;
40 }; 46 };
41 47
42 // Utility function to determine if an accessibility tree has finished loading 48 // Utility function to determine if an accessibility tree has finished loading
43 // or if the tree represents a page that hasn't finished loading yet. 49 // or if the tree represents a page that hasn't finished loading yet.
44 bool AccessibilityTreeIsLoaded(BrowserAccessibilityManager* manager) { 50 bool AccessibilityTreeIsLoaded(BrowserAccessibilityManager* manager) {
45 BrowserAccessibility* root = manager->GetRoot(); 51 BrowserAccessibility* root = manager->GetRoot();
46 return (root->GetFloatAttribute(ui::AX_ATTR_DOC_LOADING_PROGRESS) == 1.0 && 52 return (root->GetFloatAttribute(ui::AX_ATTR_DOC_LOADING_PROGRESS) == 1.0 &&
47 root->GetStringAttribute(ui::AX_ATTR_DOC_URL) != url::kAboutBlankURL); 53 root->GetStringAttribute(ui::AX_ATTR_DOC_URL) != url::kAboutBlankURL);
48 } 54 }
49 55
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 BrowserAccessibility* ax_child_frame_static_text = 159 BrowserAccessibility* ax_child_frame_static_text =
154 ax_child_frame_group->PlatformGetChild(0); 160 ax_child_frame_group->PlatformGetChild(0);
155 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); 161 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole());
156 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); 162 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount());
157 163
158 // Last, check that the parent of the child frame root is correct. 164 // Last, check that the parent of the child frame root is correct.
159 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); 165 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area);
160 } 166 }
161 167
162 } // namespace content 168 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698