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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/views/widget/widget_delegate.h" | 28 #include "ui/views/widget/widget_delegate.h" |
29 | 29 |
30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
31 #include "ui/base/win/scoped_ole_initializer.h" | 31 #include "ui/base/win/scoped_ole_initializer.h" |
32 #endif | 32 #endif |
33 | 33 |
34 #if defined(USE_AURA) | 34 #if defined(USE_AURA) |
35 #include "ui/aura/test/aura_test_helper.h" | 35 #include "ui/aura/test/aura_test_helper.h" |
36 #include "ui/aura/window_event_dispatcher.h" | 36 #include "ui/aura/window_event_dispatcher.h" |
37 #include "ui/compositor/test/context_factories_for_test.h" | 37 #include "ui/compositor/test/context_factories_for_test.h" |
| 38 #include "ui/wm/core/default_activation_client.h" |
38 #endif | 39 #endif |
39 | 40 |
40 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
41 | 42 |
42 class AccessibilityViewsDelegate : public views::TestViewsDelegate { | 43 class AccessibilityViewsDelegate : public views::TestViewsDelegate { |
43 public: | 44 public: |
44 AccessibilityViewsDelegate() {} | 45 AccessibilityViewsDelegate() {} |
45 virtual ~AccessibilityViewsDelegate() {} | 46 virtual ~AccessibilityViewsDelegate() {} |
46 | 47 |
47 // Overridden from views::TestViewsDelegate: | 48 // Overridden from views::TestViewsDelegate: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 107 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
107 #endif | 108 #endif |
108 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); | 109 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); |
109 #if defined(USE_AURA) | 110 #if defined(USE_AURA) |
110 // The ContextFactory must exist before any Compositors are created. | 111 // The ContextFactory must exist before any Compositors are created. |
111 bool enable_pixel_output = false; | 112 bool enable_pixel_output = false; |
112 ui::InitializeContextFactoryForTests(enable_pixel_output); | 113 ui::InitializeContextFactoryForTests(enable_pixel_output); |
113 | 114 |
114 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 115 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
115 aura_test_helper_->SetUp(); | 116 aura_test_helper_->SetUp(); |
| 117 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
116 #endif // USE_AURA | 118 #endif // USE_AURA |
117 EnableAccessibilityAndListenToFocusNotifications(); | 119 EnableAccessibilityAndListenToFocusNotifications(); |
118 } | 120 } |
119 | 121 |
120 virtual void TearDown() { | 122 virtual void TearDown() { |
121 ClearCallback(); | 123 ClearCallback(); |
122 #if defined(USE_AURA) | 124 #if defined(USE_AURA) |
123 aura_test_helper_->TearDown(); | 125 aura_test_helper_->TearDown(); |
124 ui::TerminateContextFactoryForTests(); | 126 ui::TerminateContextFactoryForTests(); |
125 #endif | 127 #endif |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 501 |
500 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( | 502 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( |
501 menu_container, | 503 menu_container, |
502 menu->GetMenuItemByID(kTestCases[i].command_id), | 504 menu->GetMenuItemByID(kTestCases[i].command_id), |
503 &index, | 505 &index, |
504 &count); | 506 &count); |
505 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; | 507 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; |
506 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; | 508 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; |
507 } | 509 } |
508 } | 510 } |
OLD | NEW |