| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "content/browser/accessibility/browser_accessibility.h" | 6 #include "content/browser/accessibility/browser_accessibility.h" |
| 7 #include "content/browser/accessibility/browser_accessibility_manager.h" | 7 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test.h" | 10 #include "content/public/test/content_browser_test.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 WebContentsImpl* web_contents = | 27 WebContentsImpl* web_contents = |
| 28 static_cast<WebContentsImpl*>(shell()->web_contents()); | 28 static_cast<WebContentsImpl*>(shell()->web_contents()); |
| 29 FrameTree* frame_tree = web_contents->GetFrameTree(); | 29 FrameTree* frame_tree = web_contents->GetFrameTree(); |
| 30 BrowserAccessibilityManager* manager = | 30 BrowserAccessibilityManager* manager = |
| 31 web_contents->GetRootBrowserAccessibilityManager(); | 31 web_contents->GetRootBrowserAccessibilityManager(); |
| 32 | 32 |
| 33 AccessibilityNotificationWaiter hover_waiter( | 33 AccessibilityNotificationWaiter hover_waiter( |
| 34 shell()->web_contents(), AccessibilityModeComplete, ui::AX_EVENT_HOVER); | 34 shell()->web_contents(), AccessibilityModeComplete, ui::AX_EVENT_HOVER); |
| 35 for (FrameTreeNode* node : frame_tree->Nodes()) | 35 for (FrameTreeNode* node : frame_tree->Nodes()) |
| 36 hover_waiter.ListenToAdditionalFrame(node->current_frame_host()); | 36 hover_waiter.ListenToAdditionalFrame(node->current_frame_host()); |
| 37 manager->delegate()->AccessibilityHitTest(point); | 37 manager->HitTest(point); |
| 38 hover_waiter.WaitForNotification(); | 38 hover_waiter.WaitForNotification(); |
| 39 | 39 |
| 40 RenderFrameHostImpl* target_frame = hover_waiter.event_render_frame_host(); | 40 RenderFrameHostImpl* target_frame = hover_waiter.event_render_frame_host(); |
| 41 BrowserAccessibilityManager* target_manager = | 41 BrowserAccessibilityManager* target_manager = |
| 42 target_frame->browser_accessibility_manager(); | 42 target_frame->browser_accessibility_manager(); |
| 43 int hover_target_id = hover_waiter.event_target_id(); | 43 int hover_target_id = hover_waiter.event_target_id(); |
| 44 BrowserAccessibility* hovered_node = | 44 BrowserAccessibility* hovered_node = |
| 45 target_manager->GetFromID(hover_target_id); | 45 target_manager->GetFromID(hover_target_id); |
| 46 return hovered_node; | 46 return hovered_node; |
| 47 } | 47 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // (50, 505) -> div in second iframe | 213 // (50, 505) -> div in second iframe |
| 214 hovered_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); | 214 hovered_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); |
| 215 ASSERT_TRUE(hovered_node != NULL); | 215 ASSERT_TRUE(hovered_node != NULL); |
| 216 ASSERT_NE(ui::AX_ROLE_DIV, hovered_node->GetRole()); | 216 ASSERT_NE(ui::AX_ROLE_DIV, hovered_node->GetRole()); |
| 217 hovered_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); | 217 hovered_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); |
| 218 ASSERT_EQ(ui::AX_ROLE_DIV, hovered_node->GetRole()); | 218 ASSERT_EQ(ui::AX_ROLE_DIV, hovered_node->GetRole()); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace content | 221 } // namespace content |
| OLD | NEW |