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