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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 AccessibilityMode accessibility_mode) { | 109 AccessibilityMode accessibility_mode) { |
110 AccessibilityNotificationWaiter waiter( | 110 AccessibilityNotificationWaiter waiter( |
111 shell()->web_contents(), accessibility_mode, ui::AX_EVENT_LOAD_COMPLETE); | 111 shell()->web_contents(), accessibility_mode, ui::AX_EVENT_LOAD_COMPLETE); |
112 GURL html_data_url("data:text/html," + html); | 112 GURL html_data_url("data:text/html," + html); |
113 NavigateToURL(shell(), html_data_url); | 113 NavigateToURL(shell(), html_data_url); |
114 waiter.WaitForNotification(); | 114 waiter.WaitForNotification(); |
115 } | 115 } |
116 | 116 |
117 // Retrieve the MSAA client accessibility object for the Render Widget Host View | 117 // Retrieve the MSAA client accessibility object for the Render Widget Host View |
118 // of the selected tab. | 118 // of the selected tab. |
119 IAccessible* AccessibilityWinBrowserTest::GetRendererAccessible() { | 119 IAccessible* AccessibilityWinBrowserTest::GetRendererAccessible() { |
dmazzoni
2017/05/08 04:45:24
I love that this file didn't need any major change
dougt
2017/05/08 16:53:35
+1000
| |
120 content::WebContents* web_contents = shell()->web_contents(); | 120 content::WebContents* web_contents = shell()->web_contents(); |
121 return web_contents->GetRenderWidgetHostView()->GetNativeViewAccessible(); | 121 return web_contents->GetRenderWidgetHostView()->GetNativeViewAccessible(); |
122 } | 122 } |
123 | 123 |
124 void AccessibilityWinBrowserTest::ExecuteScript(const std::wstring& script) { | 124 void AccessibilityWinBrowserTest::ExecuteScript(const std::wstring& script) { |
125 shell()->web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(script); | 125 shell()->web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(script); |
126 } | 126 } |
127 | 127 |
128 // Loads a page with an input text field and places sample text in it. Also, | 128 // Loads a page with an input text field and places sample text in it. Also, |
129 // places the caret on the last character. | 129 // places the caret on the last character. |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1689 // Test special offsets. | 1689 // Test special offsets. |
1690 CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_CARET, | 1690 CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_CARET, |
1691 IA2_TEXT_BOUNDARY_WORD, 40, CONTENTS_LENGTH, L"like\"."); | 1691 IA2_TEXT_BOUNDARY_WORD, 40, CONTENTS_LENGTH, L"like\"."); |
1692 } | 1692 } |
1693 | 1693 |
1694 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 1694 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
1695 TestStaticTextAtOffsetWithBoundaryWord) { | 1695 TestStaticTextAtOffsetWithBoundaryWord) { |
1696 base::win::ScopedComPtr<IAccessibleText> paragraph_text; | 1696 base::win::ScopedComPtr<IAccessibleText> paragraph_text; |
1697 SetUpSampleParagraph(¶graph_text); | 1697 SetUpSampleParagraph(¶graph_text); |
1698 base::string16 embedded_character( | 1698 base::string16 embedded_character( |
1699 1, BrowserAccessibilityWin::kEmbeddedCharacter); | 1699 1, BrowserAccessibilityComWin::kEmbeddedCharacter); |
1700 std::vector<std::wstring> words; | 1700 std::vector<std::wstring> words; |
1701 words.push_back(L"Game "); | 1701 words.push_back(L"Game "); |
1702 words.push_back(L"theory "); | 1702 words.push_back(L"theory "); |
1703 words.push_back(L"is \""); | 1703 words.push_back(L"is \""); |
1704 words.push_back(L"the "); | 1704 words.push_back(L"the "); |
1705 words.push_back(L"study "); | 1705 words.push_back(L"study "); |
1706 words.push_back(L"of "); | 1706 words.push_back(L"of "); |
1707 words.push_back(embedded_character); | 1707 words.push_back(embedded_character); |
1708 words.push_back(L"of "); | 1708 words.push_back(L"of "); |
1709 words.push_back(L"conflict "); | 1709 words.push_back(L"conflict "); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2041 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); | 2041 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); |
2042 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); | 2042 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); |
2043 EXPECT_EQ(1, row_index); | 2043 EXPECT_EQ(1, row_index); |
2044 EXPECT_EQ(1, column_index); | 2044 EXPECT_EQ(1, column_index); |
2045 variant.Reset(); | 2045 variant.Reset(); |
2046 name.Reset(); | 2046 name.Reset(); |
2047 accessible_cell.Reset(); | 2047 accessible_cell.Reset(); |
2048 } | 2048 } |
2049 | 2049 |
2050 } // namespace content | 2050 } // namespace content |
OLD | NEW |