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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return NULL; | 77 return NULL; |
78 | 78 |
79 return browser_window_testing->GetBookmarkBarView(); | 79 return browser_window_testing->GetBookmarkBarView(); |
80 } | 80 } |
81 | 81 |
82 // Retrieves and verifies the accessibility object for the given View. | 82 // Retrieves and verifies the accessibility object for the given View. |
83 void TestViewAccessibilityObject(views::View* view, std::wstring name, | 83 void TestViewAccessibilityObject(views::View* view, std::wstring name, |
84 int32 role) { | 84 int32 role) { |
85 ASSERT_TRUE(NULL != view); | 85 ASSERT_TRUE(NULL != view); |
86 | 86 |
87 TestAccessibilityInfo( | 87 TestAccessibilityInfo(view->GetNativeViewAccessible(), name, role); |
88 NativeViewAccessibilityWin::GetAccessibleForView(view), | |
89 name, | |
90 role); | |
91 } | 88 } |
92 | 89 |
93 | 90 |
94 // Verifies MSAA Name and Role properties of the given IAccessible. | 91 // Verifies MSAA Name and Role properties of the given IAccessible. |
95 void TestAccessibilityInfo(IAccessible* acc_obj, std::wstring name, | 92 void TestAccessibilityInfo(IAccessible* acc_obj, std::wstring name, |
96 int32 role) { | 93 int32 role) { |
97 // Verify MSAA Name property. | 94 // Verify MSAA Name property. |
98 BSTR acc_name; | 95 BSTR acc_name; |
99 | 96 |
100 HRESULT hr = acc_obj->get_accName(id_self, &acc_name); | 97 HRESULT hr = acc_obj->get_accName(id_self, &acc_name); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 ASSERT_EQ(S_OK, hr); | 263 ASSERT_EQ(S_OK, hr); |
267 ASSERT_TRUE(NULL != acc_obj); | 264 ASSERT_TRUE(NULL != acc_obj); |
268 | 265 |
269 TestAccessibilityInfo( | 266 TestAccessibilityInfo( |
270 acc_obj, | 267 acc_obj, |
271 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), | 268 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), |
272 ROLE_SYSTEM_DIALOG); | 269 ROLE_SYSTEM_DIALOG); |
273 | 270 |
274 acc_obj->Release(); | 271 acc_obj->Release(); |
275 } | 272 } |
OLD | NEW |