| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_com_initializer.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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 | 49 |
| 49 // Retrieves and verifies the accessibility object for the given View. | 50 // Retrieves and verifies the accessibility object for the given View. |
| 50 void TestViewAccessibilityObject(views::View* view, | 51 void TestViewAccessibilityObject(views::View* view, |
| 51 std::wstring name, | 52 std::wstring name, |
| 52 int32 role); | 53 int32 role); |
| 53 | 54 |
| 54 // Verifies MSAA Name and Role properties of the given IAccessible. | 55 // Verifies MSAA Name and Role properties of the given IAccessible. |
| 55 void TestAccessibilityInfo(IAccessible* acc_obj, | 56 void TestAccessibilityInfo(IAccessible* acc_obj, |
| 56 std::wstring name, | 57 std::wstring name, |
| 57 int32 role); | 58 int32 role); |
| 59 |
| 60 private: |
| 61 base::win::ScopedCOMInitializer com_initializer_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(BrowserViewsAccessibilityTest); |
| 58 }; | 64 }; |
| 59 | 65 |
| 60 BrowserViewsAccessibilityTest::BrowserViewsAccessibilityTest() { | 66 BrowserViewsAccessibilityTest::BrowserViewsAccessibilityTest() { |
| 61 ui::win::CreateATLModuleIfNeeded(); | 67 ui::win::CreateATLModuleIfNeeded(); |
| 62 ::CoInitialize(NULL); | |
| 63 } | 68 } |
| 64 | 69 |
| 65 BrowserViewsAccessibilityTest::~BrowserViewsAccessibilityTest() { | 70 BrowserViewsAccessibilityTest::~BrowserViewsAccessibilityTest() { |
| 66 ::CoUninitialize(); | |
| 67 } | 71 } |
| 68 | 72 |
| 69 BrowserWindowTesting* BrowserViewsAccessibilityTest::GetBrowserWindowTesting() { | 73 BrowserWindowTesting* BrowserViewsAccessibilityTest::GetBrowserWindowTesting() { |
| 70 BrowserWindow* browser_window = browser()->window(); | 74 BrowserWindow* browser_window = browser()->window(); |
| 71 return browser_window ? browser_window->GetBrowserWindowTesting() : NULL; | 75 return browser_window ? browser_window->GetBrowserWindowTesting() : NULL; |
| 72 } | 76 } |
| 73 | 77 |
| 74 BrowserView* BrowserViewsAccessibilityTest::GetBrowserView() { | 78 BrowserView* BrowserViewsAccessibilityTest::GetBrowserView() { |
| 75 return BrowserView::GetBrowserViewForBrowser(browser()); | 79 return BrowserView::GetBrowserViewForBrowser(browser()); |
| 76 } | 80 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 } | 258 } |
| 255 | 259 |
| 256 // http://crbug.com/104132 | 260 // http://crbug.com/104132 |
| 257 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, | 261 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, |
| 258 DISABLED_TestBookmarkBarViewAccObj) { | 262 DISABLED_TestBookmarkBarViewAccObj) { |
| 259 TestViewAccessibilityObject( | 263 TestViewAccessibilityObject( |
| 260 GetBookmarkBarView(), | 264 GetBookmarkBarView(), |
| 261 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), | 265 UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), |
| 262 ROLE_SYSTEM_TOOLBAR); | 266 ROLE_SYSTEM_TOOLBAR); |
| 263 } | 267 } |
| OLD | NEW |