| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3102 // Wait for focus to land on the "root web area" role, representing | 3102 // Wait for focus to land on the "root web area" role, representing |
| 3103 // focus on the main document itself. | 3103 // focus on the main document itself. |
| 3104 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != | 3104 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != |
| 3105 ui::AX_ROLE_ROOT_WEB_AREA) { | 3105 ui::AX_ROLE_ROOT_WEB_AREA) { |
| 3106 content::WaitForAccessibilityFocusChange(); | 3106 content::WaitForAccessibilityFocusChange(); |
| 3107 } | 3107 } |
| 3108 | 3108 |
| 3109 // Now keep pressing the Tab key until focus lands on a button. | 3109 // Now keep pressing the Tab key until focus lands on a button. |
| 3110 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != | 3110 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != |
| 3111 ui::AX_ROLE_BUTTON) { | 3111 ui::AX_ROLE_BUTTON) { |
| 3112 content::SimulateKeyPress( | 3112 content::SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('\t'), |
| 3113 web_contents, ui::VKEY_TAB, false, false, false, false); | 3113 ui::DomCode::TAB, ui::VKEY_TAB, false, false, |
| 3114 false, false); |
| 3114 content::WaitForAccessibilityFocusChange(); | 3115 content::WaitForAccessibilityFocusChange(); |
| 3115 } | 3116 } |
| 3116 | 3117 |
| 3117 // Ensure that we hit the button inside the guest frame labeled | 3118 // Ensure that we hit the button inside the guest frame labeled |
| 3118 // "Guest button". | 3119 // "Guest button". |
| 3119 ui::AXNodeData node_data = | 3120 ui::AXNodeData node_data = |
| 3120 content::GetFocusedAccessibilityNodeInfo(web_contents); | 3121 content::GetFocusedAccessibilityNodeInfo(web_contents); |
| 3121 EXPECT_EQ("Guest button", node_data.GetStringAttribute(ui::AX_ATTR_NAME)); | 3122 EXPECT_EQ("Guest button", node_data.GetStringAttribute(ui::AX_ATTR_NAME)); |
| 3122 } | 3123 } |
| 3123 | 3124 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3584 gfx::Point embedder_origin = | 3585 gfx::Point embedder_origin = |
| 3585 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3586 GetEmbedderWebContents()->GetContainerBounds().origin(); |
| 3586 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3587 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
| 3587 | 3588 |
| 3588 // Generate and send synthetic touch event. | 3589 // Generate and send synthetic touch event. |
| 3589 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3590 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 3590 guest_rect.CenterPoint()); | 3591 guest_rect.CenterPoint()); |
| 3591 EXPECT_TRUE(aura_webview->HasFocus()); | 3592 EXPECT_TRUE(aura_webview->HasFocus()); |
| 3592 } | 3593 } |
| 3593 #endif | 3594 #endif |
| OLD | NEW |