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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 596863003: Status Trays delayed visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 "ash/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 1067 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
1068 window).work_area().bottom(), 1068 window).work_area().bottom(),
1069 widget->GetWorkAreaBoundsInScreen().bottom()); 1069 widget->GetWorkAreaBoundsInScreen().bottom());
1070 1070
1071 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 1071 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1072 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); 1072 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1073 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 1073 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
1074 window).work_area().bottom(), 1074 window).work_area().bottom(),
1075 widget->GetWorkAreaBoundsInScreen().bottom()); 1075 widget->GetWorkAreaBoundsInScreen().bottom());
1076 1076
1077 ui::ScopedAnimationDurationScaleMode animation_duration(
1078 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION);
1079
1077 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 1080 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1081 ShelfWidget* shelf_widget = GetShelfWidget();
1082 EXPECT_TRUE(shelf_widget->status_area_widget()->IsVisible());
1083 StepWidgetLayerAnimatorToEnd(shelf_widget);
1084 StepWidgetLayerAnimatorToEnd(shelf_widget->status_area_widget());
1078 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); 1085 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
1079 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 1086 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
1080 window).work_area().bottom(), 1087 window).work_area().bottom(),
1081 widget->GetWorkAreaBoundsInScreen().bottom()); 1088 widget->GetWorkAreaBoundsInScreen().bottom());
1082 } 1089 }
1083 1090
1084 // Basic assertions around the dimming of the shelf. 1091 // Basic assertions around the dimming of the shelf.
1085 TEST_F(ShelfLayoutManagerTest, TestDimmingBehavior) { 1092 TEST_F(ShelfLayoutManagerTest, TestDimmingBehavior) {
1086 // Since ShelfLayoutManager queries for mouse location, move the mouse so 1093 // Since ShelfLayoutManager queries for mouse location, move the mouse so
1087 // it isn't over the shelf. 1094 // it isn't over the shelf.
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN); 2022 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
2016 gfx::Rect hide_target_bounds = status_window->GetTargetBounds(); 2023 gfx::Rect hide_target_bounds = status_window->GetTargetBounds();
2017 EXPECT_GT(hide_target_bounds.y(), initial_bounds.y()); 2024 EXPECT_GT(hide_target_bounds.y(), initial_bounds.y());
2018 2025
2019 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 2026 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
2020 gfx::Rect reshow_target_bounds = status_window->GetTargetBounds(); 2027 gfx::Rect reshow_target_bounds = status_window->GetTargetBounds();
2021 EXPECT_EQ(initial_bounds, reshow_target_bounds); 2028 EXPECT_EQ(initial_bounds, reshow_target_bounds);
2022 } 2029 }
2023 2030
2024 } // namespace ash 2031 } // namespace ash
OLDNEW
« ash/shelf/shelf_layout_manager.cc ('K') | « ash/shelf/shelf_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698