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/atl_module.h" |
8 #include "base/win/scoped_comptr.h" | 9 #include "base/win/scoped_comptr.h" |
9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
11 #include "chrome/browser/ui/view_ids.h" | 12 #include "chrome/browser/ui/view_ids.h" |
12 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 13 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
13 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
14 #include "chrome/browser/ui/views/toolbar_view.h" | 15 #include "chrome/browser/ui/views/toolbar_view.h" |
15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
18 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
19 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
20 #include "ui/base/accessibility/accessibility_types.h" | 21 #include "ui/base/accessibility/accessibility_types.h" |
21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
22 #include "views/accessibility/native_view_accessibility_win.h" | 23 #include "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() { |
39 ::CoInitialize(NULL); | 35 base::win::CreateATLModuleIfNeeded(); |
40 } | 36 } |
41 | 37 |
42 ~BrowserViewsAccessibilityTest() { | 38 ~BrowserViewsAccessibilityTest() { |
43 ::CoUninitialize(); | 39 ::CoUninitialize(); |
44 } | 40 } |
45 | 41 |
46 // Retrieves an instance of BrowserWindowTesting | 42 // Retrieves an instance of BrowserWindowTesting |
47 BrowserWindowTesting* GetBrowserWindowTesting() { | 43 BrowserWindowTesting* GetBrowserWindowTesting() { |
48 BrowserWindow* browser_window = browser()->window(); | 44 BrowserWindow* browser_window = browser()->window(); |
49 | 45 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ASSERT_EQ(S_OK, hr); | 258 ASSERT_EQ(S_OK, hr); |
263 ASSERT_TRUE(NULL != acc_obj); | 259 ASSERT_TRUE(NULL != acc_obj); |
264 | 260 |
265 TestAccessibilityInfo( | 261 TestAccessibilityInfo( |
266 acc_obj, | 262 acc_obj, |
267 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), | 263 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)), |
268 ROLE_SYSTEM_DIALOG); | 264 ROLE_SYSTEM_DIALOG); |
269 | 265 |
270 acc_obj->Release(); | 266 acc_obj->Release(); |
271 } | 267 } |
OLD | NEW |