| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include <oleacc.h> | 5 #include <oleacc.h> |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/view_ids.h" | 10 #include "chrome/browser/view_ids.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class BrowserViewsAccessibilityTest : public InProcessBrowserTest { | 28 class BrowserViewsAccessibilityTest : public InProcessBrowserTest { |
| 29 public: | 29 public: |
| 30 BrowserViewsAccessibilityTest() { | 30 BrowserViewsAccessibilityTest() { |
| 31 ::CoInitialize(NULL); | 31 ::CoInitialize(NULL); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ~BrowserViewsAccessibilityTest() { | 34 ~BrowserViewsAccessibilityTest() { |
| 35 ::CoUninitialize(); | 35 ::CoUninitialize(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Retrieves and initializes an instance of LocationBarView. |
| 39 LocationBarView* GetLocationBarView() { |
| 40 BrowserWindow* browser_window = browser()->window(); |
| 41 |
| 42 if (!browser_window) |
| 43 return NULL; |
| 44 |
| 45 BrowserWindowTesting* browser_window_testing = |
| 46 browser_window->GetBrowserWindowTesting(); |
| 47 |
| 48 if (!browser_window_testing) |
| 49 return NULL; |
| 50 |
| 51 return browser_window_testing->GetLocationBarView(); |
| 52 } |
| 53 |
| 38 // Retrieves and initializes an instance of ToolbarView. | 54 // Retrieves and initializes an instance of ToolbarView. |
| 39 ToolbarView* GetToolbarView() { | 55 ToolbarView* GetToolbarView() { |
| 40 BrowserWindow* browser_window = browser()->window(); | 56 BrowserWindow* browser_window = browser()->window(); |
| 41 | 57 |
| 42 if (!browser_window) | 58 if (!browser_window) |
| 43 return NULL; | 59 return NULL; |
| 44 | 60 |
| 45 BrowserWindowTesting* browser_window_testing = | 61 BrowserWindowTesting* browser_window_testing = |
| 46 browser_window->GetBrowserWindowTesting(); | 62 browser_window->GetBrowserWindowTesting(); |
| 47 | 63 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 182 } |
| 167 | 183 |
| 168 // Retrieve accessibility object for Star button and verify accessibility info. | 184 // Retrieve accessibility object for Star button and verify accessibility info. |
| 169 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestStarButtonAccObj) { | 185 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestStarButtonAccObj) { |
| 170 // Verify Star button MSAA name and role. | 186 // Verify Star button MSAA name and role. |
| 171 TestViewAccessibilityObject( | 187 TestViewAccessibilityObject( |
| 172 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), | 188 GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), |
| 173 l10n_util::GetString(IDS_ACCNAME_STAR), ROLE_SYSTEM_PUSHBUTTON); | 189 l10n_util::GetString(IDS_ACCNAME_STAR), ROLE_SYSTEM_PUSHBUTTON); |
| 174 } | 190 } |
| 175 | 191 |
| 192 // Retrieve accessibility object for location bar view and verify accessibility |
| 193 // info. |
| 194 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 195 TestLocationBarViewAccObj) { |
| 196 // Verify location bar MSAA name and role. |
| 197 TestViewAccessibilityObject(GetLocationBarView(), |
| 198 l10n_util::GetString(IDS_ACCNAME_LOCATION), |
| 199 ROLE_SYSTEM_GROUPING); |
| 200 } |
| 201 |
| 176 // Retrieve accessibility object for Go button and verify accessibility info. | 202 // Retrieve accessibility object for Go button and verify accessibility info. |
| 177 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestGoButtonAccObj) { | 203 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestGoButtonAccObj) { |
| 178 // Verify Go button MSAA name and role. | 204 // Verify Go button MSAA name and role. |
| 179 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_GO_BUTTON), | 205 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_GO_BUTTON), |
| 180 l10n_util::GetString(IDS_ACCNAME_GO), | 206 l10n_util::GetString(IDS_ACCNAME_GO), |
| 181 ROLE_SYSTEM_PUSHBUTTON); | 207 ROLE_SYSTEM_PUSHBUTTON); |
| 182 } | 208 } |
| 183 | 209 |
| 184 // Retrieve accessibility object for Page menu button and verify accessibility | 210 // Retrieve accessibility object for Page menu button and verify accessibility |
| 185 // info. | 211 // info. |
| 186 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestPageMenuAccObj) { | 212 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestPageMenuAccObj) { |
| 187 // Verify Page menu button MSAA name and role. | 213 // Verify Page menu button MSAA name and role. |
| 188 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_PAGE_MENU), | 214 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_PAGE_MENU), |
| 189 l10n_util::GetString(IDS_ACCNAME_PAGE), | 215 l10n_util::GetString(IDS_ACCNAME_PAGE), |
| 190 ROLE_SYSTEM_BUTTONMENU); | 216 ROLE_SYSTEM_BUTTONMENU); |
| 191 } | 217 } |
| 192 | 218 |
| 193 // Retrieve accessibility object for App menu button and verify accessibility | 219 // Retrieve accessibility object for App menu button and verify accessibility |
| 194 // info. | 220 // info. |
| 195 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestAppMenuAccObj) { | 221 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestAppMenuAccObj) { |
| 196 // Verify App menu button MSAA name and role. | 222 // Verify App menu button MSAA name and role. |
| 197 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), | 223 TestViewAccessibilityObject(GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), |
| 198 l10n_util::GetString(IDS_ACCNAME_APP), | 224 l10n_util::GetString(IDS_ACCNAME_APP), |
| 199 ROLE_SYSTEM_BUTTONMENU); | 225 ROLE_SYSTEM_BUTTONMENU); |
| 200 } | 226 } |
| 201 | 227 |
| 202 } // Namespace. | 228 } // Namespace. |
| 203 | 229 |
| OLD | NEW |