| 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" |
| 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/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 18 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "ui/base/accessibility/accessibility_types.h" | 20 #include "ui/base/accessibility/accessibility_types.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/base/win/atl_module.h" |
| 22 #include "ui/views/accessibility/native_view_accessibility_win.h" | 23 #include "ui/views/accessibility/native_view_accessibility_win.h" |
| 23 #include "views/widget/widget.h" | 24 #include "views/widget/widget.h" |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 VARIANT id_self = {VT_I4, CHILDID_SELF}; | 28 VARIANT id_self = {VT_I4, CHILDID_SELF}; |
| 28 | 29 |
| 29 // Dummy class to force creation of ATL module, needed by COM to instantiate | |
| 30 // NativeViewAccessibilityWin. | |
| 31 class TestAtlModule : public CAtlDllModuleT<TestAtlModule> {}; | |
| 32 TestAtlModule test_atl_module_; | |
| 33 | |
| 34 } // namespace | 30 } // namespace |
| 35 | 31 |
| 36 class BrowserViewsAccessibilityTest : public InProcessBrowserTest { | 32 class BrowserViewsAccessibilityTest : public InProcessBrowserTest { |
| 37 public: | 33 public: |
| 38 BrowserViewsAccessibilityTest() { | 34 BrowserViewsAccessibilityTest() { |
| 35 ui::win::CreateATLModuleIfNeeded(); |
| 39 ::CoInitialize(NULL); | 36 ::CoInitialize(NULL); |
| 40 } | 37 } |
| 41 | 38 |
| 42 ~BrowserViewsAccessibilityTest() { | 39 ~BrowserViewsAccessibilityTest() { |
| 43 ::CoUninitialize(); | 40 ::CoUninitialize(); |
| 44 } | 41 } |
| 45 | 42 |
| 46 // Retrieves an instance of BrowserWindowTesting | 43 // Retrieves an instance of BrowserWindowTesting |
| 47 BrowserWindowTesting* GetBrowserWindowTesting() { | 44 BrowserWindowTesting* GetBrowserWindowTesting() { |
| 48 BrowserWindow* browser_window = browser()->window(); | 45 BrowserWindow* browser_window = browser()->window(); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 ASSERT_EQ(S_OK, hr); | 261 ASSERT_EQ(S_OK, hr); |
| 265 ASSERT_TRUE(NULL != acc_obj); | 262 ASSERT_TRUE(NULL != acc_obj); |
| 266 | 263 |
| 267 TestAccessibilityInfo( | 264 TestAccessibilityInfo( |
| 268 acc_obj, | 265 acc_obj, |
| 269 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), | 266 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), |
| 270 ROLE_SYSTEM_DIALOG); | 267 ROLE_SYSTEM_DIALOG); |
| 271 | 268 |
| 272 acc_obj->Release(); | 269 acc_obj->Release(); |
| 273 } | 270 } |
| OLD | NEW |