| 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 13 matching lines...) Expand all Loading... |
| 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/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 #include "ui/gfx/screen.h" |
| 34 #endif | 35 #endif |
| 35 | 36 |
| 36 #if defined(TOOLKIT_VIEWS) | 37 #if defined(TOOLKIT_VIEWS) |
| 37 | 38 |
| 38 class AccessibilityViewsDelegate : public views::ViewsDelegate { | 39 class AccessibilityViewsDelegate : public views::ViewsDelegate { |
| 39 public: | 40 public: |
| 40 AccessibilityViewsDelegate() {} | 41 AccessibilityViewsDelegate() {} |
| 41 virtual ~AccessibilityViewsDelegate() {} | 42 virtual ~AccessibilityViewsDelegate() {} |
| 42 | 43 |
| 43 // Overridden from views::ViewsDelegate: | 44 // Overridden from views::ViewsDelegate: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 class AccessibilityEventRouterViewsTest | 132 class AccessibilityEventRouterViewsTest |
| 132 : public testing::Test, | 133 : public testing::Test, |
| 133 public content::NotificationObserver { | 134 public content::NotificationObserver { |
| 134 public: | 135 public: |
| 135 virtual void SetUp() { | 136 virtual void SetUp() { |
| 136 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); | 137 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); |
| 137 #if defined(USE_AURA) | 138 #if defined(USE_AURA) |
| 138 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager); | 139 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager); |
| 139 root_window_.reset( | 140 root_window_.reset( |
| 140 aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); | 141 aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); |
| 141 #if defined(USE_ASH) | 142 #if defined(USE_AURA) |
| 142 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 143 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
| 143 #endif // USE_ASH | 144 #endif // USE_ASH |
| 144 test_stacking_client_.reset( | 145 test_stacking_client_.reset( |
| 145 new aura::test::TestStackingClient(root_window_.get())); | 146 new aura::test::TestStackingClient(root_window_.get())); |
| 146 #endif // USE_AURA | 147 #endif // USE_AURA |
| 147 } | 148 } |
| 148 | 149 |
| 149 virtual void TearDown() { | 150 virtual void TearDown() { |
| 150 #if defined(USE_AURA) | 151 #if defined(USE_AURA) |
| 151 test_stacking_client_.reset(); | 152 test_stacking_client_.reset(); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 334 |
| 334 // Test that we got the event with the expected name and context. | 335 // Test that we got the event with the expected name and context. |
| 335 EXPECT_EQ(1, focus_event_count_); | 336 EXPECT_EQ(1, focus_event_count_); |
| 336 EXPECT_EQ(kButtonNameASCII, last_control_name_); | 337 EXPECT_EQ(kButtonNameASCII, last_control_name_); |
| 337 EXPECT_EQ(kAlertTextASCII, last_control_context_); | 338 EXPECT_EQ(kAlertTextASCII, last_control_context_); |
| 338 | 339 |
| 339 window->CloseNow(); | 340 window->CloseNow(); |
| 340 } | 341 } |
| 341 | 342 |
| 342 #endif // defined(TOOLKIT_VIEWS) | 343 #endif // defined(TOOLKIT_VIEWS) |
| OLD | NEW |