Index: chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
diff --git a/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
index 49328c7660394396b2f5a6058604d344e096ee64..12ae6da0504e9e0391f8506b57ff2fc3cfee0615 100644 |
--- a/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
+++ b/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
@@ -52,6 +52,7 @@ class AccessibilityViewsDelegate : public views::TestViewsDelegate { |
view, event_type); |
} |
+ private: |
DISALLOW_COPY_AND_ASSIGN(AccessibilityViewsDelegate); |
}; |
@@ -106,14 +107,16 @@ class AccessibilityEventRouterViewsTest |
#if defined(OS_WIN) |
ole_initializer_.reset(new ui::ScopedOleInitializer()); |
#endif |
- views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); |
+ views_delegate_.reset(new AccessibilityViewsDelegate); |
#if defined(USE_AURA) |
// The ContextFactory must exist before any Compositors are created. |
bool enable_pixel_output = false; |
- ui::InitializeContextFactoryForTests(enable_pixel_output); |
+ ui::ContextFactory* context_factory = |
+ ui::InitializeContextFactoryForTests(enable_pixel_output); |
aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
- aura_test_helper_->SetUp(); |
+ aura_test_helper_->SetUp(context_factory); |
+ views_delegate_->set_context_factory(context_factory); |
new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
#endif // USE_AURA |
EnableAccessibilityAndListenToFocusNotifications(); |
@@ -125,8 +128,7 @@ class AccessibilityEventRouterViewsTest |
aura_test_helper_->TearDown(); |
ui::TerminateContextFactoryForTests(); |
#endif |
- delete views::ViewsDelegate::views_delegate; |
- views::ViewsDelegate::views_delegate = NULL; |
+ views_delegate_.reset(); |
// The Widget's FocusManager is deleted using DeleteSoon - this |
// forces it to be deleted now, so we don't have any memory leaks |
@@ -192,6 +194,7 @@ class AccessibilityEventRouterViewsTest |
#if defined(USE_AURA) |
scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
#endif |
+ scoped_ptr<AccessibilityViewsDelegate> views_delegate_; |
}; |
TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) { |