Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 1995613003: views/mus: Fix some flaky crashes during test teardown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-mus-more-focus-fix
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <memory> 6 #include <memory>
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 generator.ClickLeftButton(); 1945 generator.ClickLeftButton();
1946 EXPECT_FALSE(deletion_observer.IsWidgetAlive()); 1946 EXPECT_FALSE(deletion_observer.IsWidgetAlive());
1947 1947
1948 // Yay we did not crash! 1948 // Yay we did not crash!
1949 } 1949 }
1950 1950
1951 // No touch on desktop Mac. Tracked in http://crbug.com/445520. 1951 // No touch on desktop Mac. Tracked in http://crbug.com/445520.
1952 #if !defined(OS_MACOSX) || defined(USE_AURA) 1952 #if !defined(OS_MACOSX) || defined(USE_AURA)
1953 1953
1954 TEST_F(WidgetTest, WidgetDeleted_InDispatchGestureEvent) { 1954 TEST_F(WidgetTest, WidgetDeleted_InDispatchGestureEvent) {
1955 // This test doesn't make sense for mus. Force NativeWidgetAura to be used. 1955 // This test doesn't make sense for mus.
1956 DisableNativeWidgetMus(); 1956 if (IsMus())
1957 return;
1957 1958
1958 Widget* widget = new Widget; 1959 Widget* widget = new Widget;
1959 Widget::InitParams params = 1960 Widget::InitParams params =
1960 CreateParams(views::Widget::InitParams::TYPE_POPUP); 1961 CreateParams(views::Widget::InitParams::TYPE_POPUP);
1961 widget->Init(params); 1962 widget->Init(params);
1962 1963
1963 widget->SetContentsView(new CloseWidgetView(ui::ET_GESTURE_TAP_DOWN)); 1964 widget->SetContentsView(new CloseWidgetView(ui::ET_GESTURE_TAP_DOWN));
1964 1965
1965 widget->SetSize(gfx::Size(100, 100)); 1966 widget->SetSize(gfx::Size(100, 100));
1966 widget->Show(); 1967 widget->Show();
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
3616 // Moving the child to a different widget should call the removals observer. 3617 // Moving the child to a different widget should call the removals observer.
3617 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); 3618 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget());
3618 widget2->client_view()->AddChildView(child); 3619 widget2->client_view()->AddChildView(child);
3619 EXPECT_TRUE(removals_observer.DidRemoveView(child)); 3620 EXPECT_TRUE(removals_observer.DidRemoveView(child));
3620 3621
3621 widget->RemoveRemovalsObserver(&removals_observer); 3622 widget->RemoveRemovalsObserver(&removals_observer);
3622 } 3623 }
3623 3624
3624 } // namespace test 3625 } // namespace test
3625 } // namespace views 3626 } // namespace views
OLDNEW
« ui/views/mus/surface_binding.cc ('K') | « ui/views/test/views_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698