| Index: chrome/browser/views/accessibility_event_router_views_unittest.cc
|
| ===================================================================
|
| --- chrome/browser/views/accessibility_event_router_views_unittest.cc (revision 55065)
|
| +++ chrome/browser/views/accessibility_event_router_views_unittest.cc (working copy)
|
| @@ -16,6 +16,7 @@
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "views/controls/button/native_button.h"
|
| #include "views/grid_layout.h"
|
| +#include "views/views_delegate.h"
|
| #include "views/widget/root_view.h"
|
| #include "views/window/window.h"
|
|
|
| @@ -27,10 +28,54 @@
|
|
|
| #if defined(TOOLKIT_VIEWS)
|
|
|
| +class AccessibilityViewsDelegate : public views::ViewsDelegate {
|
| + public:
|
| + AccessibilityViewsDelegate() {}
|
| + virtual ~AccessibilityViewsDelegate() {}
|
| +
|
| + // Overridden from views::ViewsDelegate:
|
| + virtual Clipboard* GetClipboard() const { return NULL; }
|
| + virtual void SaveWindowPlacement(const std::wstring& window_name,
|
| + const gfx::Rect& bounds,
|
| + bool maximized) {
|
| + }
|
| + virtual bool GetSavedWindowBounds(const std::wstring& window_name,
|
| + gfx::Rect* bounds) const {
|
| + return false;
|
| + }
|
| + virtual bool GetSavedMaximizedState(const std::wstring& window_name,
|
| + bool* maximized) const {
|
| + return false;
|
| + }
|
| + virtual void NotifyAccessibilityEvent(
|
| + views::View* view, AccessibilityTypes::Event event_type) {
|
| + AccessibilityEventRouterViews::GetInstance()->HandleAccessibilityEvent(
|
| + view, event_type);
|
| + }
|
| +#if defined(OS_WIN)
|
| + virtual HICON GetDefaultWindowIcon() const {
|
| + return NULL;
|
| + }
|
| +#endif
|
| + virtual void AddRef() {}
|
| + virtual void ReleaseRef() {}
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AccessibilityViewsDelegate);
|
| +};
|
| +
|
| class AccessibilityEventRouterViewsTest
|
| : public testing::Test,
|
| public NotificationObserver {
|
| public:
|
| + virtual void SetUp() {
|
| + views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate();
|
| + }
|
| +
|
| + virtual void TearDown() {
|
| + delete views::ViewsDelegate::views_delegate;
|
| + views::ViewsDelegate::views_delegate = NULL;
|
| + }
|
| +
|
| views::Widget* CreateWidget() {
|
| #if defined(OS_WIN)
|
| return new views::WidgetWin();
|
| @@ -38,6 +83,7 @@
|
| return new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW);
|
| #endif
|
| }
|
| +
|
| protected:
|
| // Implement NotificationObserver::Observe and store information about a
|
| // ACCESSIBILITY_CONTROL_FOCUSED event.
|
|
|