From 754bebc123ff35ecd50c68f43b7675953b1cb431 Mon Sep 17 00:00:00 2001 From: "sadrul@chromium.org" Date: Thu, 1 Dec 2011 16:42:16 +0000 Subject: aura: Fix unit_tests on linux Make sure the aura::Desktop is destroyed with the message-loop. This is done by adding a DestroyMessagePump notification to MessagePumpObserver. Also remove some views_unittests that were added to test NativeWidgetViews (which aren't used anymore), and do proper cleanup in AccessibilityEventRouter unittest. TBR=darin@chromium.org BUG=104559, 105613 TEST=unit_tests Review URL: http://codereview.chromium.org/8566037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112474 0039d316-1c4b-4281-b951-d872f2087c98 --- .../ui/views/accessibility_event_router_views_unittest.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'chrome/browser/ui/views/accessibility_event_router_views_unittest.cc') diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc index 1f5dbba..be7c828 100644 --- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc +++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc @@ -90,20 +90,17 @@ class AccessibilityEventRouterViewsTest public: virtual void SetUp() { views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); - window_delegate_ = NULL; } virtual void TearDown() { delete views::ViewsDelegate::views_delegate; views::ViewsDelegate::views_delegate = NULL; - if (window_delegate_) - delete window_delegate_; } views::Widget* CreateWindowWithContents(views::View* contents) { - window_delegate_ = new AccessibilityWindowDelegate(contents); - return views::Widget::CreateWindowWithBounds(window_delegate_, - gfx::Rect(0, 0, 500, 500)); + return views::Widget::CreateWindowWithBounds( + new AccessibilityWindowDelegate(contents), + gfx::Rect(0, 0, 500, 500)); } protected: @@ -122,7 +119,6 @@ class AccessibilityEventRouterViewsTest MessageLoopForUI message_loop_; int focus_event_count_; std::string last_control_name_; - AccessibilityWindowDelegate* window_delegate_; }; TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) { @@ -184,6 +180,8 @@ TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) { focus_manager->AdvanceFocus(false); EXPECT_EQ(3, focus_event_count_); EXPECT_EQ(kButton1ASCII, last_control_name_); + + window->CloseNow(); } #endif // defined(TOOLKIT_VIEWS) -- cgit v1.1