| 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 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 "web_view/shim", NEEDS_TEST_SERVER); | 3231 "web_view/shim", NEEDS_TEST_SERVER); |
| 3232 } | 3232 } |
| 3233 | 3233 |
| 3234 // Tests that a WebView accessible resource can actually be loaded from a | 3234 // Tests that a WebView accessible resource can actually be loaded from a |
| 3235 // webpage in a WebView. | 3235 // webpage in a WebView. |
| 3236 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewAccessibleResource) { | 3236 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewAccessibleResource) { |
| 3237 TestHelper("testLoadWebviewAccessibleResource", | 3237 TestHelper("testLoadWebviewAccessibleResource", |
| 3238 "web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER); | 3238 "web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER); |
| 3239 } | 3239 } |
| 3240 | 3240 |
| 3241 IN_PROC_BROWSER_TEST_P(WebViewAccessibilityTest, LoadWebViewAccessibility) { |
| 3242 LoadAppWithGuest("web_view/focus_accessibility"); |
| 3243 content::WebContents* web_contents = GetFirstAppWindowWebContents(); |
| 3244 content::EnableAccessibilityForWebContents(web_contents); |
| 3245 content::WebContents* guest_web_contents = GetGuestWebContents(); |
| 3246 content::EnableAccessibilityForWebContents(guest_web_contents); |
| 3247 content::WaitForAccessibilityTreeToContainNodeWithName(web_contents, |
| 3248 "Guest button"); |
| 3249 } |
| 3250 |
| 3241 IN_PROC_BROWSER_TEST_P(WebViewAccessibilityTest, FocusAccessibility) { | 3251 IN_PROC_BROWSER_TEST_P(WebViewAccessibilityTest, FocusAccessibility) { |
| 3242 LoadAppWithGuest("web_view/focus_accessibility"); | 3252 LoadAppWithGuest("web_view/focus_accessibility"); |
| 3243 content::WebContents* web_contents = GetFirstAppWindowWebContents(); | 3253 content::WebContents* web_contents = GetFirstAppWindowWebContents(); |
| 3244 content::EnableAccessibilityForWebContents(web_contents); | 3254 content::EnableAccessibilityForWebContents(web_contents); |
| 3245 content::WebContents* guest_web_contents = GetGuestWebContents(); | 3255 content::WebContents* guest_web_contents = GetGuestWebContents(); |
| 3246 content::EnableAccessibilityForWebContents(guest_web_contents); | 3256 content::EnableAccessibilityForWebContents(guest_web_contents); |
| 3247 | 3257 |
| 3248 // Wait for focus to land on the "root web area" role, representing | 3258 // Wait for focus to land on the "root web area" role, representing |
| 3249 // focus on the main document itself. | 3259 // focus on the main document itself. |
| 3250 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != | 3260 while (content::GetFocusedAccessibilityNodeInfo(web_contents).role != |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3816 gfx::Point embedder_origin = | 3826 gfx::Point embedder_origin = |
| 3817 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3827 GetEmbedderWebContents()->GetContainerBounds().origin(); |
| 3818 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3828 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
| 3819 | 3829 |
| 3820 // Generate and send synthetic touch event. | 3830 // Generate and send synthetic touch event. |
| 3821 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3831 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 3822 guest_rect.CenterPoint()); | 3832 guest_rect.CenterPoint()); |
| 3823 EXPECT_TRUE(aura_webview->HasFocus()); | 3833 EXPECT_TRUE(aura_webview->HasFocus()); |
| 3824 } | 3834 } |
| 3825 #endif | 3835 #endif |
| OLD | NEW |