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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/views/views_delegate.h" | 21 #include "ui/views/views_delegate.h" |
22 #include "ui/views/widget/native_widget.h" | 22 #include "ui/views/widget/native_widget.h" |
23 #include "ui/views/widget/root_view.h" | 23 #include "ui/views/widget/root_view.h" |
24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
25 #include "ui/views/widget/widget_delegate.h" | 25 #include "ui/views/widget/widget_delegate.h" |
26 | 26 |
27 #if defined(USE_AURA) | 27 #if defined(USE_AURA) |
28 #include "ui/aura/env.h" | 28 #include "ui/aura/env.h" |
29 #include "ui/aura/monitor_manager.h" | 29 #include "ui/aura/monitor_manager.h" |
30 #include "ui/aura/root_window.h" | 30 #include "ui/aura/root_window.h" |
31 #include "ui/aura/test/single_monitor_manager.h" | 31 #include "ui/aura/single_monitor_manager.h" |
32 #include "ui/aura/test/test_screen.h" | 32 #include "ui/aura/test/test_screen.h" |
33 #include "ui/aura/test/test_stacking_client.h" | 33 #include "ui/aura/test/test_stacking_client.h" |
34 #endif | 34 #endif |
35 | 35 |
36 #if defined(TOOLKIT_VIEWS) | 36 #if defined(TOOLKIT_VIEWS) |
37 | 37 |
38 class AccessibilityViewsDelegate : public views::ViewsDelegate { | 38 class AccessibilityViewsDelegate : public views::ViewsDelegate { |
39 public: | 39 public: |
40 AccessibilityViewsDelegate() {} | 40 AccessibilityViewsDelegate() {} |
41 virtual ~AccessibilityViewsDelegate() {} | 41 virtual ~AccessibilityViewsDelegate() {} |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ui::AccessibilityTypes::Role role_; | 121 ui::AccessibilityTypes::Role role_; |
122 }; | 122 }; |
123 | 123 |
124 class AccessibilityEventRouterViewsTest | 124 class AccessibilityEventRouterViewsTest |
125 : public testing::Test, | 125 : public testing::Test, |
126 public content::NotificationObserver { | 126 public content::NotificationObserver { |
127 public: | 127 public: |
128 virtual void SetUp() { | 128 virtual void SetUp() { |
129 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); | 129 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); |
130 #if defined(USE_AURA) | 130 #if defined(USE_AURA) |
131 aura::Env::GetInstance()->SetMonitorManager( | 131 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager); |
132 new aura::test::SingleMonitorManager); | |
133 root_window_.reset( | 132 root_window_.reset( |
134 aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); | 133 aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); |
135 #if defined(USE_ASH) | 134 #if defined(USE_ASH) |
136 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 135 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
137 #endif // USE_ASH | 136 #endif // USE_ASH |
138 test_stacking_client_.reset( | 137 test_stacking_client_.reset( |
139 new aura::test::TestStackingClient(root_window_.get())); | 138 new aura::test::TestStackingClient(root_window_.get())); |
140 #endif // USE_AURA | 139 #endif // USE_AURA |
141 } | 140 } |
142 | 141 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 326 |
328 // Test that we got the event with the expected name and context. | 327 // Test that we got the event with the expected name and context. |
329 EXPECT_EQ(1, focus_event_count_); | 328 EXPECT_EQ(1, focus_event_count_); |
330 EXPECT_EQ(kButtonNameASCII, last_control_name_); | 329 EXPECT_EQ(kButtonNameASCII, last_control_name_); |
331 EXPECT_EQ(kAlertTextASCII, last_control_context_); | 330 EXPECT_EQ(kAlertTextASCII, last_control_context_); |
332 | 331 |
333 window->CloseNow(); | 332 window->CloseNow(); |
334 } | 333 } |
335 | 334 |
336 #endif // defined(TOOLKIT_VIEWS) | 335 #endif // defined(TOOLKIT_VIEWS) |
OLD | NEW |