| 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 <oleacc.h> | 5 #include <oleacc.h> |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/win/scoped_com_initializer.h" | 8 #include "base/win/scoped_com_initializer.h" |
| 9 #include "base/win/scoped_comptr.h" | 9 #include "base/win/scoped_comptr.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ASSERT_TRUE(NULL != hwnd); | 127 ASSERT_TRUE(NULL != hwnd); |
| 128 | 128 |
| 129 // Get accessibility object. | 129 // Get accessibility object. |
| 130 base::win::ScopedComPtr<IAccessible> acc_obj; | 130 base::win::ScopedComPtr<IAccessible> acc_obj; |
| 131 HRESULT hr = ::AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, IID_IAccessible, | 131 HRESULT hr = ::AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, IID_IAccessible, |
| 132 reinterpret_cast<void**>(&acc_obj)); | 132 reinterpret_cast<void**>(&acc_obj)); |
| 133 ASSERT_EQ(S_OK, hr); | 133 ASSERT_EQ(S_OK, hr); |
| 134 ASSERT_TRUE(NULL != acc_obj); | 134 ASSERT_TRUE(NULL != acc_obj); |
| 135 | 135 |
| 136 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); | 136 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); |
| 137 std::wstring title = UTF16ToWide(l10n_util::GetStringFUTF16( | 137 std::wstring title = base::UTF16ToWide(l10n_util::GetStringFUTF16( |
| 138 IDS_BROWSER_WINDOW_TITLE_FORMAT, | 138 IDS_BROWSER_WINDOW_TITLE_FORMAT, |
| 139 ASCIIToUTF16(chrome::kAboutBlankURL))); | 139 ASCIIToUTF16(chrome::kAboutBlankURL))); |
| 140 TestAccessibilityInfo(acc_obj, title, ROLE_SYSTEM_WINDOW); | 140 TestAccessibilityInfo(acc_obj, title, ROLE_SYSTEM_WINDOW); |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Retrieve accessibility object for non client view and verify accessibility | 143 // Retrieve accessibility object for non client view and verify accessibility |
| 144 // info. | 144 // info. |
| 145 // http://crbug.com/104132 | 145 // http://crbug.com/104132 |
| 146 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 146 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 147 DISABLED_TestNonClientViewAccObj) { | 147 DISABLED_TestNonClientViewAccObj) { |
| 148 views::View* non_client_view = | 148 views::View* non_client_view = |
| 149 GetBrowserView()->GetWidget()->non_client_view(); | 149 GetBrowserView()->GetWidget()->non_client_view(); |
| 150 | 150 |
| 151 TestViewAccessibilityObject(non_client_view, | 151 TestViewAccessibilityObject(non_client_view, |
| 152 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 152 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 153 ROLE_SYSTEM_WINDOW); | 153 ROLE_SYSTEM_WINDOW); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Retrieve accessibility object for browser root view and verify | 156 // Retrieve accessibility object for browser root view and verify |
| 157 // accessibility info. | 157 // accessibility info. |
| 158 // http://crbug.com/104132 | 158 // http://crbug.com/104132 |
| 159 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 159 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 160 DISABLED_TestBrowserRootViewAccObj) { | 160 DISABLED_TestBrowserRootViewAccObj) { |
| 161 views::View* browser_root_view = GetBrowserView()->frame()->GetRootView(); | 161 views::View* browser_root_view = GetBrowserView()->frame()->GetRootView(); |
| 162 | 162 |
| 163 TestViewAccessibilityObject( | 163 TestViewAccessibilityObject( |
| 164 browser_root_view, | 164 browser_root_view, |
| 165 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 165 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 166 ROLE_SYSTEM_APPLICATION); | 166 ROLE_SYSTEM_APPLICATION); |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Retrieve accessibility object for browser view and verify accessibility info. | 169 // Retrieve accessibility object for browser view and verify accessibility info. |
| 170 // http://crbug.com/104132 | 170 // http://crbug.com/104132 |
| 171 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 171 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 172 DISABLED_TestBrowserViewAccObj) { | 172 DISABLED_TestBrowserViewAccObj) { |
| 173 // Verify root view MSAA name and role. | 173 // Verify root view MSAA name and role. |
| 174 TestViewAccessibilityObject( | 174 TestViewAccessibilityObject( |
| 175 GetBrowserView(), | 175 GetBrowserView(), |
| 176 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 176 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 177 ROLE_SYSTEM_CLIENT); | 177 ROLE_SYSTEM_CLIENT); |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Retrieve accessibility object for toolbar view and verify accessibility info. | 180 // Retrieve accessibility object for toolbar view and verify accessibility info. |
| 181 // http://crbug.com/104132 | 181 // http://crbug.com/104132 |
| 182 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 182 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 183 DISABLED_TestToolbarViewAccObj) { | 183 DISABLED_TestToolbarViewAccObj) { |
| 184 // Verify toolbar MSAA name and role. | 184 // Verify toolbar MSAA name and role. |
| 185 TestViewAccessibilityObject( | 185 TestViewAccessibilityObject( |
| 186 GetToolbarView(), | 186 GetToolbarView(), |
| 187 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), | 187 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), |
| 188 ROLE_SYSTEM_TOOLBAR); | 188 ROLE_SYSTEM_TOOLBAR); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Retrieve accessibility object for Back button and verify accessibility info. | 191 // Retrieve accessibility object for Back button and verify accessibility info. |
| 192 // http://crbug.com/104132 | 192 // http://crbug.com/104132 |
| 193 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 193 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 194 DISABLED_TestBackButtonAccObj) { | 194 DISABLED_TestBackButtonAccObj) { |
| 195 // Verify Back button MSAA name and role. | 195 // Verify Back button MSAA name and role. |
| 196 TestViewAccessibilityObject( | 196 TestViewAccessibilityObject( |
| 197 GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), | 197 GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), |
| 198 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), | 198 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), |
| 199 ROLE_SYSTEM_BUTTONDROPDOWN); | 199 ROLE_SYSTEM_BUTTONDROPDOWN); |
| 200 } | 200 } |
| 201 | 201 |
| 202 // Retrieve accessibility object for Forward button and verify accessibility | 202 // Retrieve accessibility object for Forward button and verify accessibility |
| 203 // info. | 203 // info. |
| 204 // http://crbug.com/104132 | 204 // http://crbug.com/104132 |
| 205 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 205 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 206 DISABLED_TestForwardButtonAccObj) { | 206 DISABLED_TestForwardButtonAccObj) { |
| 207 // Verify Forward button MSAA name and role. | 207 // Verify Forward button MSAA name and role. |
| 208 TestViewAccessibilityObject( | 208 TestViewAccessibilityObject( |
| 209 GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), | 209 GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), |
| 210 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), | 210 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), |
| 211 ROLE_SYSTEM_BUTTONDROPDOWN); | 211 ROLE_SYSTEM_BUTTONDROPDOWN); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // Retrieve accessibility object for Reload button and verify accessibility | 214 // Retrieve accessibility object for Reload button and verify accessibility |
| 215 // info. | 215 // info. |
| 216 // http://crbug.com/104132 | 216 // http://crbug.com/104132 |
| 217 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 217 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 218 DISABLED_TestReloadButtonAccObj) { | 218 DISABLED_TestReloadButtonAccObj) { |
| 219 // Verify Reload button MSAA name and role. | 219 // Verify Reload button MSAA name and role. |
| 220 TestViewAccessibilityObject( | 220 TestViewAccessibilityObject( |
| 221 GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), | 221 GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), |
| 222 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), | 222 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), |
| 223 ROLE_SYSTEM_PUSHBUTTON); | 223 ROLE_SYSTEM_PUSHBUTTON); |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Retrieve accessibility object for Home button and verify accessibility info. | 226 // Retrieve accessibility object for Home button and verify accessibility info. |
| 227 // http://crbug.com/104132 | 227 // http://crbug.com/104132 |
| 228 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 228 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 229 DISABLED_TestHomeButtonAccObj) { | 229 DISABLED_TestHomeButtonAccObj) { |
| 230 // Verify Home button MSAA name and role. | 230 // Verify Home button MSAA name and role. |
| 231 TestViewAccessibilityObject( | 231 TestViewAccessibilityObject( |
| 232 GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), | 232 GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), |
| 233 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), | 233 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), |
| 234 ROLE_SYSTEM_PUSHBUTTON); | 234 ROLE_SYSTEM_PUSHBUTTON); |
| 235 } | 235 } |
| 236 | 236 |
| 237 // Retrieve accessibility object for Star button and verify accessibility info. | 237 // Retrieve accessibility object for Star button and verify accessibility info. |
| 238 // http://crbug.com/104132 | 238 // http://crbug.com/104132 |
| 239 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 239 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 240 DISABLED_TestStarButtonAccObj) { | 240 DISABLED_TestStarButtonAccObj) { |
| 241 // Verify Star button MSAA name and role. | 241 // Verify Star button MSAA name and role. |
| 242 TestViewAccessibilityObject( | 242 TestViewAccessibilityObject( |
| 243 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), | 243 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), |
| 244 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), | 244 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), |
| 245 ROLE_SYSTEM_PUSHBUTTON); | 245 ROLE_SYSTEM_PUSHBUTTON); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // Retrieve accessibility object for App menu button and verify accessibility | 248 // Retrieve accessibility object for App menu button and verify accessibility |
| 249 // info. | 249 // info. |
| 250 // http://crbug.com/104132 | 250 // http://crbug.com/104132 |
| 251 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 251 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 252 DISABLED_TestAppMenuAccObj) { | 252 DISABLED_TestAppMenuAccObj) { |
| 253 // Verify App menu button MSAA name and role. | 253 // Verify App menu button MSAA name and role. |
| 254 TestViewAccessibilityObject( | 254 TestViewAccessibilityObject( |
| 255 GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), | 255 GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), |
| 256 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), | 256 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), |
| 257 ROLE_SYSTEM_BUTTONMENU); | 257 ROLE_SYSTEM_BUTTONMENU); |
| 258 } | 258 } |
| 259 | 259 |
| 260 // http://crbug.com/104132 | 260 // http://crbug.com/104132 |
| 261 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 261 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 262 DISABLED_TestBookmarkBarViewAccObj) { | 262 DISABLED_TestBookmarkBarViewAccObj) { |
| 263 TestViewAccessibilityObject( | 263 TestViewAccessibilityObject( |
| 264 GetBookmarkBarView(), | 264 GetBookmarkBarView(), |
| 265 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), | 265 base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), |
| 266 ROLE_SYSTEM_TOOLBAR); | 266 ROLE_SYSTEM_TOOLBAR); |
| 267 } | 267 } |
| OLD | NEW |