| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 image->get_accName(childid_self, image_name.Receive())); | 1908 image->get_accName(childid_self, image_name.Receive())); |
| 1909 EXPECT_EQ(L"image2", std::wstring(image_name, image_name.Length())); | 1909 EXPECT_EQ(L"image2", std::wstring(image_name, image_name.Length())); |
| 1910 EXPECT_HRESULT_FAILED(image_action->doAction(1)); | 1910 EXPECT_HRESULT_FAILED(image_action->doAction(1)); |
| 1911 } | 1911 } |
| 1912 | 1912 |
| 1913 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, HasHWNDAfterNavigation) { | 1913 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, HasHWNDAfterNavigation) { |
| 1914 // This test simulates a scenario where RenderWidgetHostViewAura::SetSize | 1914 // This test simulates a scenario where RenderWidgetHostViewAura::SetSize |
| 1915 // is not called again after its window is added to the root window. | 1915 // is not called again after its window is added to the root window. |
| 1916 // Ensure that we still get a legacy HWND for accessibility. | 1916 // Ensure that we still get a legacy HWND for accessibility. |
| 1917 | 1917 |
| 1918 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 1919 ASSERT_TRUE(embedded_test_server()->Start()); | 1918 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1920 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 1919 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 1921 shell()->web_contents()); | 1920 shell()->web_contents()); |
| 1922 WebContentsView* web_contents_view = web_contents->GetView(); | 1921 WebContentsView* web_contents_view = web_contents->GetView(); |
| 1923 WebContentsViewAura* web_contents_view_aura = | 1922 WebContentsViewAura* web_contents_view_aura = |
| 1924 static_cast<WebContentsViewAura*>(web_contents_view); | 1923 static_cast<WebContentsViewAura*>(web_contents_view); |
| 1925 | 1924 |
| 1926 // Set a flag that will cause WebContentsViewAura to initialize a | 1925 // Set a flag that will cause WebContentsViewAura to initialize a |
| 1927 // RenderWidgetHostViewAura with a null parent view. | 1926 // RenderWidgetHostViewAura with a null parent view. |
| 1928 web_contents_view_aura->set_init_rwhv_with_null_parent_for_testing(true); | 1927 web_contents_view_aura->set_init_rwhv_with_null_parent_for_testing(true); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1943 ASSERT_EQ(nullptr, manager->GetParentHWND()); | 1942 ASSERT_EQ(nullptr, manager->GetParentHWND()); |
| 1944 | 1943 |
| 1945 // Now add the RWHVA's window to the root window and ensure that we have | 1944 // Now add the RWHVA's window to the root window and ensure that we have |
| 1946 // an HWND for accessibility now. | 1945 // an HWND for accessibility now. |
| 1947 web_contents_view->GetNativeView()->AddChild( | 1946 web_contents_view->GetNativeView()->AddChild( |
| 1948 web_contents->GetRenderWidgetHostView()->GetNativeView()); | 1947 web_contents->GetRenderWidgetHostView()->GetNativeView()); |
| 1949 ASSERT_NE(nullptr, manager->GetParentHWND()); | 1948 ASSERT_NE(nullptr, manager->GetParentHWND()); |
| 1950 } | 1949 } |
| 1951 | 1950 |
| 1952 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestAccNavigateInTables) { | 1951 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestAccNavigateInTables) { |
| 1953 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 1954 ASSERT_TRUE(embedded_test_server()->Start()); | 1952 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1955 AccessibilityNotificationWaiter waiter(shell()->web_contents(), | 1953 AccessibilityNotificationWaiter waiter(shell()->web_contents(), |
| 1956 kAccessibilityModeComplete, | 1954 kAccessibilityModeComplete, |
| 1957 ui::AX_EVENT_LOAD_COMPLETE); | 1955 ui::AX_EVENT_LOAD_COMPLETE); |
| 1958 NavigateToURL(shell(), embedded_test_server()->GetURL( | 1956 NavigateToURL(shell(), embedded_test_server()->GetURL( |
| 1959 "/accessibility/html/table-spans.html")); | 1957 "/accessibility/html/table-spans.html")); |
| 1960 waiter.WaitForNotification(); | 1958 waiter.WaitForNotification(); |
| 1961 | 1959 |
| 1962 base::win::ScopedComPtr<IAccessible> document(GetRendererAccessible()); | 1960 base::win::ScopedComPtr<IAccessible> document(GetRendererAccessible()); |
| 1963 std::vector<base::win::ScopedVariant> document_children = | 1961 std::vector<base::win::ScopedVariant> document_children = |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); | 2039 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); |
| 2042 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); | 2040 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); |
| 2043 EXPECT_EQ(1, row_index); | 2041 EXPECT_EQ(1, row_index); |
| 2044 EXPECT_EQ(1, column_index); | 2042 EXPECT_EQ(1, column_index); |
| 2045 variant.Reset(); | 2043 variant.Reset(); |
| 2046 name.Reset(); | 2044 name.Reset(); |
| 2047 accessible_cell.Reset(); | 2045 accessible_cell.Reset(); |
| 2048 } | 2046 } |
| 2049 | 2047 |
| 2050 } // namespace content | 2048 } // namespace content |
| OLD | NEW |