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

Unified Diff: ui/views/widget/widget_unittest.cc

Issue 2611773002: Removes code using mus client lib (Closed)
Patch Set: dont run on linux Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/widget_interactive_uitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index 22c6bdc2f76aaabe38348f7da5ba2ca996febbb1..f3686be53dcbad68271f27aa3e981858dd16fca5 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -312,7 +312,7 @@ TEST_F(WidgetTest, ChildStackedRelativeToParent) {
// NOTE: for aura-mus-client stacking of top-levels is not maintained in the
// client, so z-order of top-levels can't be determined.
- const bool check_toplevel_z_order = !IsAuraMusClient();
+ const bool check_toplevel_z_order = !IsMus();
if (check_toplevel_z_order)
EXPECT_TRUE(IsWindowStackedAbove(popover.get(), child));
EXPECT_TRUE(IsWindowStackedAbove(child, parent.get()));
@@ -988,11 +988,6 @@ TEST_F(WidgetTest, GetWindowPlacement) {
return; // Fails when swarmed. http://crbug.com/660582
#endif
- if (IsMus()) {
- NOTIMPLEMENTED();
- return;
- }
-
WidgetAutoclosePtr widget;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// On desktop-Linux cheat and use non-desktop widgets. On X11, minimize is
@@ -1103,7 +1098,7 @@ TEST_F(WidgetTest, MinimumSizeConstraints) {
widget->SetSize(smaller_size);
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// TODO(tapted): Desktop Linux ignores size constraints for SetSize. Fix it.
- const bool use_small_size = IsMus() ? false : true;
+ const bool use_small_size = true;
#else
const bool use_small_size = false;
#endif
@@ -1179,11 +1174,6 @@ TEST_F(WidgetTest, GetWindowBoundsInScreen) {
// Test that GetRestoredBounds() returns the original bounds of the window.
TEST_F(WidgetTest, MAYBE_GetRestoredBounds) {
- if (IsMus()) {
- NOTIMPLEMENTED();
- return;
- }
-
WidgetAutoclosePtr toplevel(CreateNativeDesktopWidget());
toplevel->Show();
// Initial restored bounds have non-zero size.
@@ -1305,10 +1295,6 @@ TEST_F(WidgetTest, BubbleControlsResetOnInit) {
// the case for desktop widgets on Windows. Other platforms retain the window
// size while minimized.
TEST_F(WidgetTest, TestViewWidthAfterMinimizingWidget) {
- if (IsMus()) {
- // This test is testing behavior specific to DesktopWindowTreeHostWin.
- return;
- }
// Create a widget.
Widget widget;
Widget::InitParams init_params =
@@ -1418,9 +1404,6 @@ void DesktopAuraTestValidPaintWidget::InitForTest(InitParams init_params) {
}
TEST_F(WidgetTest, DesktopNativeWidgetNoPaintAfterCloseTest) {
- // TODO(sad): Desktop widgets do not work well in mus https://crbug.com/616551
- if (IsMus())
- return;
DesktopAuraTestValidPaintWidget widget;
widget.InitForTest(CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS));
widget.WaitUntilPaint();
@@ -1433,9 +1416,6 @@ TEST_F(WidgetTest, DesktopNativeWidgetNoPaintAfterCloseTest) {
}
TEST_F(WidgetTest, DesktopNativeWidgetNoPaintAfterHideTest) {
- // TODO(sad): Desktop widgets do not work well in mus https://crbug.com/616551
- if (IsMus())
- return;
DesktopAuraTestValidPaintWidget widget;
widget.InitForTest(CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS));
widget.WaitUntilPaint();
@@ -1703,7 +1683,7 @@ TEST_F(WidgetTest, SynthesizeMouseMoveEvent) {
gfx::Point cursor_location(5, 5);
ui::test::EventGenerator generator(
- IsMus() || IsAuraMusClient() ? widget->GetNativeWindow() : GetContext(),
+ IsMus() ? widget->GetNativeWindow() : GetContext(),
widget->GetNativeWindow());
generator.MoveMouseTo(cursor_location);
@@ -1760,7 +1740,7 @@ TEST_F(WidgetTest, MouseEventDispatchWhileTouchIsDown) {
event_count_view->AddPostTargetHandler(&consumer);
ui::test::EventGenerator generator(
- IsMus() || IsAuraMusClient() ? widget->GetNativeWindow() : GetContext(),
+ IsMus() ? widget->GetNativeWindow() : GetContext(),
widget->GetNativeWindow());
generator.PressTouch();
generator.ClickLeftButton();
@@ -1792,7 +1772,7 @@ TEST_F(WidgetTest, MousePressCausesCapture) {
MousePressEventConsumer consumer;
event_count_view->AddPostTargetHandler(&consumer);
ui::test::EventGenerator generator(
- IsMus() || IsAuraMusClient() ? widget->GetNativeWindow() : GetContext(),
+ IsMus() ? widget->GetNativeWindow() : GetContext(),
widget->GetNativeWindow());
generator.PressLeftButton();
@@ -1855,7 +1835,7 @@ TEST_F(WidgetTest, CaptureDuringMousePressNotOverridden) {
CaptureEventConsumer consumer(widget2);
event_count_view->AddPostTargetHandler(&consumer);
ui::test::EventGenerator generator(
- IsMus() || IsAuraMusClient() ? widget->GetNativeWindow() : GetContext(),
+ IsMus() ? widget->GetNativeWindow() : GetContext(),
widget->GetNativeWindow());
// This event should implicitly give capture to |widget|, except that
// |consumer| will explicitly set capture on |widget2|.
@@ -1940,17 +1920,9 @@ TEST_F(WidgetWindowTitleTest, SetWindowTitleChanged_DesktopNativeWidget) {
#endif // !OS_CHROMEOS
TEST_F(WidgetTest, WidgetDeleted_InOnMousePressed) {
- // This test doesn't work in mus as it assumes widget and GetContext()
- // share an aura hierarchy. Test coverage of deletion from mouse pressed is
- // important though and should be added, hence the NOTIMPLEMENTED().
- // http://crbug.com/594260.
- if (IsMus()) {
- NOTIMPLEMENTED();
- return;
- }
// TODO: test uses GetContext(), which is not applicable to aura-mus.
// http://crbug.com/663809.
- if (IsAuraMusClient())
+ if (IsMus())
return;
Widget* widget = new Widget;
@@ -1976,12 +1948,9 @@ TEST_F(WidgetTest, WidgetDeleted_InOnMousePressed) {
#if !defined(OS_MACOSX) || defined(USE_AURA)
TEST_F(WidgetTest, WidgetDeleted_InDispatchGestureEvent) {
- // This test doesn't make sense for mus.
- if (IsMus())
- return;
// TODO: test uses GetContext(), which is not applicable to aura-mus.
// http://crbug.com/663809.
- if (IsAuraMusClient())
+ if (IsMus())
return;
Widget* widget = new Widget;
@@ -2212,7 +2181,7 @@ TEST_F(WidgetTest, NoCrashOnWidgetDelete) {
TEST_F(WidgetTest, NoCrashOnWidgetDeleteWithPendingEvents) {
// TODO: test uses GetContext(), which is not applicable to aura-mus.
// http://crbug.com/663809.
- if (IsAuraMusClient())
+ if (IsMus())
return;
std::unique_ptr<Widget> widget(new Widget);
@@ -3257,7 +3226,7 @@ TEST_F(WidgetTest, IsActiveFromDestroy) {
TEST_F(WidgetTest, MouseEventTypesViaGenerator) {
// TODO: test uses GetContext(), which is not applicable to aura-mus.
// http://crbug.com/663809.
- if (IsAuraMusClient())
+ if (IsMus())
return;
EventCountView* view = new EventCountView;
@@ -3534,11 +3503,6 @@ TEST_F(WidgetTest, DISABLED_DestroyInSysCommandNCLButtonDownOnCaption) {
// Test that SetAlwaysOnTop and IsAlwaysOnTop are consistent.
TEST_F(WidgetTest, AlwaysOnTop) {
- if (IsMus()) {
- NOTIMPLEMENTED();
- return;
- }
-
WidgetAutoclosePtr widget(CreateTopLevelNativeWidget());
EXPECT_FALSE(widget->IsAlwaysOnTop());
widget->SetAlwaysOnTop(true);
@@ -3573,7 +3537,7 @@ class ScaleFactorView : public View {
TEST_F(WidgetTest, OnDeviceScaleFactorChanged) {
// This relies on the NativeWidget being the WindowDelegate, which is not the
// case for aura-mus-client.
- if (IsAuraMusClient())
+ if (IsMus())
return;
// Automatically close the widget, but not delete it.
@@ -3683,7 +3647,7 @@ TEST_F(WidgetTest, WidgetRemovalsObserverCalledWhenMovingBetweenWidgets) {
TEST_F(WidgetTest, MouseWheelEvent) {
// TODO: test uses GetContext(), which is not applicable to aura-mus.
// http://crbug.com/663809.
- if (IsAuraMusClient())
+ if (IsMus())
return;
WidgetAutoclosePtr widget(CreateTopLevelPlatformWidget());
@@ -3725,9 +3689,6 @@ private:
// under the currently active modal top-level window. In this instance, the
// remaining top-level windows should be re-enabled.
TEST_F(WidgetTest, WindowModalOwnerDestroyedEnabledTest) {
- // Modality etc. are controlled by mus.
- if (IsMus())
- return;
// top_level_widget owns owner_dialog_widget which owns owned_dialog_widget.
Widget top_level_widget;
Widget owner_dialog_widget;
@@ -3849,9 +3810,8 @@ class CompositingWidgetTest : public views::test::WidgetTest {
InitializeWidgetForOpacity(widget, CreateParams(widget_type), opacity);
// Use NativeWidgetAura directly.
- if (IsMus() &&
- (widget_type == Widget::InitParams::TYPE_WINDOW_FRAMELESS ||
- widget_type == Widget::InitParams::TYPE_CONTROL))
+ if (widget_type == Widget::InitParams::TYPE_WINDOW_FRAMELESS ||
+ widget_type == Widget::InitParams::TYPE_CONTROL)
continue;
#if defined(OS_MACOSX)
@@ -3869,11 +3829,6 @@ class CompositingWidgetTest : public views::test::WidgetTest {
EXPECT_EQ(IsNativeWindowTransparent(widget.GetNativeWindow()),
should_be_transparent);
- // When using the Mandoline UI Service, the translucency does not rely on
- // the widget type.
- if (IsMus())
- continue;
-
#if defined(USE_X11)
if (HasCompositingManager() &&
(widget_type == Widget::InitParams::TYPE_DRAG ||
« no previous file with comments | « ui/views/widget/widget_interactive_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698