| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_comptr.h" | 8 #include "base/win/scoped_comptr.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); | 127 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); |
| 128 std::wstring title = UTF16ToWide(l10n_util::GetStringFUTF16( | 128 std::wstring title = UTF16ToWide(l10n_util::GetStringFUTF16( |
| 129 IDS_BROWSER_WINDOW_TITLE_FORMAT, | 129 IDS_BROWSER_WINDOW_TITLE_FORMAT, |
| 130 ASCIIToUTF16(chrome::kAboutBlankURL))); | 130 ASCIIToUTF16(chrome::kAboutBlankURL))); |
| 131 TestAccessibilityInfo(acc_obj, title, ROLE_SYSTEM_WINDOW); | 131 TestAccessibilityInfo(acc_obj, title, ROLE_SYSTEM_WINDOW); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Retrieve accessibility object for non client view and verify accessibility | 134 // Retrieve accessibility object for non client view and verify accessibility |
| 135 // info. | 135 // info. |
| 136 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestNonClientViewAccObj) { | 136 // http://crbug.com/104132 |
| 137 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 138 FLAKY_TestNonClientViewAccObj) { |
| 137 views::View* non_client_view = | 139 views::View* non_client_view = |
| 138 GetBrowserView()->GetWidget()->non_client_view(); | 140 GetBrowserView()->GetWidget()->non_client_view(); |
| 139 | 141 |
| 140 TestViewAccessibilityObject(non_client_view, | 142 TestViewAccessibilityObject(non_client_view, |
| 141 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 143 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 142 ROLE_SYSTEM_WINDOW); | 144 ROLE_SYSTEM_WINDOW); |
| 143 } | 145 } |
| 144 | 146 |
| 145 // Retrieve accessibility object for browser root view and verify | 147 // Retrieve accessibility object for browser root view and verify |
| 146 // accessibility info. | 148 // accessibility info. |
| 149 // http://crbug.com/104132 |
| 147 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 150 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 148 TestBrowserRootViewAccObj) { | 151 FLAKY_TestBrowserRootViewAccObj) { |
| 149 views::View* browser_root_view = GetBrowserView()->frame()->GetRootView(); | 152 views::View* browser_root_view = GetBrowserView()->frame()->GetRootView(); |
| 150 | 153 |
| 151 TestViewAccessibilityObject( | 154 TestViewAccessibilityObject( |
| 152 browser_root_view, | 155 browser_root_view, |
| 153 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 156 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 154 ROLE_SYSTEM_APPLICATION); | 157 ROLE_SYSTEM_APPLICATION); |
| 155 } | 158 } |
| 156 | 159 |
| 157 // Retrieve accessibility object for browser view and verify accessibility info. | 160 // Retrieve accessibility object for browser view and verify accessibility info. |
| 158 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestBrowserViewAccObj) { | 161 // http://crbug.com/104132 |
| 162 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 163 FLAKY_TestBrowserViewAccObj) { |
| 159 // Verify root view MSAA name and role. | 164 // Verify root view MSAA name and role. |
| 160 TestViewAccessibilityObject( | 165 TestViewAccessibilityObject( |
| 161 GetBrowserView(), | 166 GetBrowserView(), |
| 162 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 167 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 163 ROLE_SYSTEM_CLIENT); | 168 ROLE_SYSTEM_CLIENT); |
| 164 } | 169 } |
| 165 | 170 |
| 166 // Retrieve accessibility object for toolbar view and verify accessibility info. | 171 // Retrieve accessibility object for toolbar view and verify accessibility info. |
| 167 // Crashing occasionally: http://crbug.com/104132 | 172 // http://crbug.com/104132 |
| 168 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 173 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 169 FLAKY_TestToolbarViewAccObj) { | 174 FLAKY_TestToolbarViewAccObj) { |
| 170 // Verify toolbar MSAA name and role. | 175 // Verify toolbar MSAA name and role. |
| 171 TestViewAccessibilityObject( | 176 TestViewAccessibilityObject( |
| 172 GetToolbarView(), | 177 GetToolbarView(), |
| 173 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), | 178 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), |
| 174 ROLE_SYSTEM_TOOLBAR); | 179 ROLE_SYSTEM_TOOLBAR); |
| 175 } | 180 } |
| 176 | 181 |
| 177 // Retrieve accessibility object for Back button and verify accessibility info. | 182 // Retrieve accessibility object for Back button and verify accessibility info. |
| 178 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestBackButtonAccObj) { | 183 // http://crbug.com/104132 |
| 184 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 185 FLAKY_TestBackButtonAccObj) { |
| 179 // Verify Back button MSAA name and role. | 186 // Verify Back button MSAA name and role. |
| 180 TestViewAccessibilityObject( | 187 TestViewAccessibilityObject( |
| 181 GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), | 188 GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), |
| 182 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), | 189 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), |
| 183 ROLE_SYSTEM_BUTTONDROPDOWN); | 190 ROLE_SYSTEM_BUTTONDROPDOWN); |
| 184 } | 191 } |
| 185 | 192 |
| 186 // Retrieve accessibility object for Forward button and verify accessibility | 193 // Retrieve accessibility object for Forward button and verify accessibility |
| 187 // info. | 194 // info. |
| 188 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestForwardButtonAccObj) { | 195 // http://crbug.com/104132 |
| 196 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 197 FLAKY_TestForwardButtonAccObj) { |
| 189 // Verify Forward button MSAA name and role. | 198 // Verify Forward button MSAA name and role. |
| 190 TestViewAccessibilityObject( | 199 TestViewAccessibilityObject( |
| 191 GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), | 200 GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), |
| 192 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), | 201 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), |
| 193 ROLE_SYSTEM_BUTTONDROPDOWN); | 202 ROLE_SYSTEM_BUTTONDROPDOWN); |
| 194 } | 203 } |
| 195 | 204 |
| 196 // Retrieve accessibility object for Reload button and verify accessibility | 205 // Retrieve accessibility object for Reload button and verify accessibility |
| 197 // info. | 206 // info. |
| 198 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestReloadButtonAccObj) { | 207 // http://crbug.com/104132 |
| 208 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 209 FLAKY_TestReloadButtonAccObj) { |
| 199 // Verify Reload button MSAA name and role. | 210 // Verify Reload button MSAA name and role. |
| 200 TestViewAccessibilityObject( | 211 TestViewAccessibilityObject( |
| 201 GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), | 212 GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), |
| 202 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), | 213 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), |
| 203 ROLE_SYSTEM_PUSHBUTTON); | 214 ROLE_SYSTEM_PUSHBUTTON); |
| 204 } | 215 } |
| 205 | 216 |
| 206 // Retrieve accessibility object for Home button and verify accessibility info. | 217 // Retrieve accessibility object for Home button and verify accessibility info. |
| 207 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestHomeButtonAccObj) { | 218 // http://crbug.com/104132 |
| 219 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 220 FLAKY_TestHomeButtonAccObj) { |
| 208 // Verify Home button MSAA name and role. | 221 // Verify Home button MSAA name and role. |
| 209 TestViewAccessibilityObject( | 222 TestViewAccessibilityObject( |
| 210 GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), | 223 GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), |
| 211 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), | 224 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), |
| 212 ROLE_SYSTEM_PUSHBUTTON); | 225 ROLE_SYSTEM_PUSHBUTTON); |
| 213 } | 226 } |
| 214 | 227 |
| 215 // Retrieve accessibility object for Star button and verify accessibility info. | 228 // Retrieve accessibility object for Star button and verify accessibility info. |
| 229 // http://crbug.com/104132 |
| 216 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 230 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 217 TestStarButtonAccObj) { | 231 FLAKY_TestStarButtonAccObj) { |
| 218 // Verify Star button MSAA name and role. | 232 // Verify Star button MSAA name and role. |
| 219 TestViewAccessibilityObject( | 233 TestViewAccessibilityObject( |
| 220 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), | 234 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), |
| 221 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), | 235 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), |
| 222 ROLE_SYSTEM_PUSHBUTTON); | 236 ROLE_SYSTEM_PUSHBUTTON); |
| 223 } | 237 } |
| 224 | 238 |
| 225 // Retrieve accessibility object for App menu button and verify accessibility | 239 // Retrieve accessibility object for App menu button and verify accessibility |
| 226 // info. | 240 // info. |
| 227 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestAppMenuAccObj) { | 241 // http://crbug.com/104132 |
| 242 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, FLAKY_TestAppMenuAccObj) { |
| 228 // Verify App menu button MSAA name and role. | 243 // Verify App menu button MSAA name and role. |
| 229 TestViewAccessibilityObject( | 244 TestViewAccessibilityObject( |
| 230 GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), | 245 GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), |
| 231 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), | 246 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), |
| 232 ROLE_SYSTEM_BUTTONMENU); | 247 ROLE_SYSTEM_BUTTONMENU); |
| 233 } | 248 } |
| 234 | 249 |
| 250 // http://crbug.com/104132 |
| 235 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 251 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 236 TestBookmarkBarViewAccObj) { | 252 FLAKY_TestBookmarkBarViewAccObj) { |
| 237 TestViewAccessibilityObject( | 253 TestViewAccessibilityObject( |
| 238 GetBookmarkBarView(), | 254 GetBookmarkBarView(), |
| 239 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), | 255 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), |
| 240 ROLE_SYSTEM_TOOLBAR); | 256 ROLE_SYSTEM_TOOLBAR); |
| 241 } | 257 } |
| 242 | 258 |
| 243 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 259 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 244 TestAboutChromeViewAccObj) { | 260 TestAboutChromeViewAccObj) { |
| 245 // Firstly, test that the WindowDelegate got updated. | 261 // Firstly, test that the WindowDelegate got updated. |
| 246 views::Widget* about_chrome_window = | 262 views::Widget* about_chrome_window = |
| (...skipping 14 matching lines...) Expand all Loading... |
| 261 ASSERT_EQ(S_OK, hr); | 277 ASSERT_EQ(S_OK, hr); |
| 262 ASSERT_TRUE(NULL != acc_obj); | 278 ASSERT_TRUE(NULL != acc_obj); |
| 263 | 279 |
| 264 TestAccessibilityInfo( | 280 TestAccessibilityInfo( |
| 265 acc_obj, | 281 acc_obj, |
| 266 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), | 282 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), |
| 267 ROLE_SYSTEM_DIALOG); | 283 ROLE_SYSTEM_DIALOG); |
| 268 | 284 |
| 269 acc_obj->Release(); | 285 acc_obj->Release(); |
| 270 } | 286 } |
| OLD | NEW |