| 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 "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 #include "content/browser/web_contents/web_contents_impl.h" | 6 #include "content/browser/web_contents/web_contents_impl.h" |
| 7 #include "content/common/accessibility_messages.h" | 7 #include "content/common/accessibility_messages.h" |
| 8 #include "content/public/test/browser_test_utils.h" | 8 #include "content/public/test/browser_test_utils.h" |
| 9 #include "content/public/test/content_browser_test.h" | 9 #include "content/public/test/content_browser_test.h" |
| 10 #include "content/public/test/content_browser_test_utils.h" | 10 #include "content/public/test/content_browser_test_utils.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 shell(), AccessibilityModeComplete, ui::AX_EVENT_FOCUS); | 100 shell(), AccessibilityModeComplete, ui::AX_EVENT_FOCUS); |
| 101 ASSERT_TRUE(ExecuteScript( | 101 ASSERT_TRUE(ExecuteScript( |
| 102 shell()->web_contents(), | 102 shell()->web_contents(), |
| 103 "document.getElementById('button').focus();")); | 103 "document.getElementById('button').focus();")); |
| 104 waiter.WaitForNotification(); | 104 waiter.WaitForNotification(); |
| 105 tree = &waiter.GetAXTree(); | 105 tree = &waiter.GetAXTree(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Get the accessibility tree, ensure it reflects the final state of the | 108 // Get the accessibility tree, ensure it reflects the final state of the |
| 109 // document. | 109 // document. |
| 110 const ui::AXNode* root = tree->GetRoot(); | 110 const ui::AXNode* root = tree->root(); |
| 111 | 111 |
| 112 // Use this for debugging if the test fails. | 112 // Use this for debugging if the test fails. |
| 113 VLOG(1) << tree->ToString(); | 113 VLOG(1) << tree->ToString(); |
| 114 | 114 |
| 115 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->data().role); | 115 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->data().role); |
| 116 ASSERT_EQ(2, root->child_count()); | 116 ASSERT_EQ(2, root->child_count()); |
| 117 | 117 |
| 118 const ui::AXNode* live_region = root->ChildAtIndex(0); | 118 const ui::AXNode* live_region = root->ChildAtIndex(0); |
| 119 ASSERT_EQ(1, live_region->child_count()); | 119 ASSERT_EQ(1, live_region->child_count()); |
| 120 EXPECT_EQ(ui::AX_ROLE_DIV, live_region->data().role); | 120 EXPECT_EQ(ui::AX_ROLE_DIV, live_region->data().role); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // Wait for the renderer to be killed. | 182 // Wait for the renderer to be killed. |
| 183 if (frame->IsRenderFrameLive()) { | 183 if (frame->IsRenderFrameLive()) { |
| 184 RenderProcessHostWatcher render_process_watcher( | 184 RenderProcessHostWatcher render_process_watcher( |
| 185 frame->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 185 frame->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
| 186 render_process_watcher.Wait(); | 186 render_process_watcher.Wait(); |
| 187 } | 187 } |
| 188 ASSERT_FALSE(frame->IsRenderFrameLive()); | 188 ASSERT_FALSE(frame->IsRenderFrameLive()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace content | 191 } // namespace content |
| OLD | NEW |