| 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/scoped_comptr_win.h" | |
| 8 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.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" |
| 11 #include "chrome/browser/ui/view_ids.h" | 11 #include "chrome/browser/ui/view_ids.h" |
| 12 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 12 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 14 #include "chrome/browser/ui/views/toolbar_view.h" | 14 #include "chrome/browser/ui/views/toolbar_view.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "chrome/test/in_process_browser_test.h" | 16 #include "chrome/test/in_process_browser_test.h" |
| 17 #include "chrome/test/ui_test_utils.h" | 17 #include "chrome/test/ui_test_utils.h" |
| 18 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Retrieve accessibility object for main window and verify accessibility info. | 120 // Retrieve accessibility object for main window and verify accessibility info. |
| 121 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 121 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 122 TestChromeWindowAccObj) { | 122 TestChromeWindowAccObj) { |
| 123 BrowserWindow* browser_window = browser()->window(); | 123 BrowserWindow* browser_window = browser()->window(); |
| 124 ASSERT_TRUE(NULL != browser_window); | 124 ASSERT_TRUE(NULL != browser_window); |
| 125 | 125 |
| 126 HWND hwnd = browser_window->GetNativeHandle(); | 126 HWND hwnd = browser_window->GetNativeHandle(); |
| 127 ASSERT_TRUE(NULL != hwnd); | 127 ASSERT_TRUE(NULL != hwnd); |
| 128 | 128 |
| 129 // Get accessibility object. | 129 // Get accessibility object. |
| 130 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 = 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); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 ASSERT_EQ(S_OK, hr); | 269 ASSERT_EQ(S_OK, hr); |
| 270 ASSERT_TRUE(NULL != acc_obj); | 270 ASSERT_TRUE(NULL != acc_obj); |
| 271 | 271 |
| 272 TestAccessibilityInfo( | 272 TestAccessibilityInfo( |
| 273 acc_obj, | 273 acc_obj, |
| 274 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), | 274 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), |
| 275 ROLE_SYSTEM_DIALOG); | 275 ROLE_SYSTEM_DIALOG); |
| 276 | 276 |
| 277 acc_obj->Release(); | 277 acc_obj->Release(); |
| 278 } | 278 } |
| OLD | NEW |