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

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

Issue 2985453003: fix shelf color with modal dialog. (Closed)
Patch Set: fix tests Created 3 years, 4 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
« no previous file with comments | « no previous file | ash/wm/focus_rules.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/app_list/test_app_list_view_presenter_impl.h" 9 #include "ash/app_list/test_app_list_view_presenter_impl.h"
10 #include "ash/focus_cycler.h" 10 #include "ash/focus_cycler.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "ui/display/manager/display_manager.h" 49 #include "ui/display/manager/display_manager.h"
50 #include "ui/display/screen.h" 50 #include "ui/display/screen.h"
51 #include "ui/display/test/display_manager_test_api.h" 51 #include "ui/display/test/display_manager_test_api.h"
52 #include "ui/events/gesture_detection/gesture_configuration.h" 52 #include "ui/events/gesture_detection/gesture_configuration.h"
53 #include "ui/events/test/event_generator.h" 53 #include "ui/events/test/event_generator.h"
54 #include "ui/keyboard/keyboard_controller.h" 54 #include "ui/keyboard/keyboard_controller.h"
55 #include "ui/keyboard/keyboard_ui.h" 55 #include "ui/keyboard/keyboard_ui.h"
56 #include "ui/keyboard/keyboard_util.h" 56 #include "ui/keyboard/keyboard_util.h"
57 #include "ui/views/view.h" 57 #include "ui/views/view.h"
58 #include "ui/views/widget/widget.h" 58 #include "ui/views/widget/widget.h"
59 #include "ui/wm/core/window_util.h"
59 60
60 namespace ash { 61 namespace ash {
61 namespace { 62 namespace {
62 63
63 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) { 64 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) {
64 widget->GetNativeView()->layer()->GetAnimator()->Step( 65 widget->GetNativeView()->layer()->GetAnimator()->Step(
65 base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); 66 base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1));
66 } 67 }
67 68
68 ShelfWidget* GetShelfWidget() { 69 ShelfWidget* GetShelfWidget() {
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 // Still background is 'maximized'. 1755 // Still background is 'maximized'.
1755 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); 1756 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType());
1756 1757
1757 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 1758 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
1758 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); 1759 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType());
1759 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 1760 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
1760 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); 1761 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType());
1761 1762
1762 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 1763 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
1763 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); 1764 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType());
1765
1766 std::unique_ptr<aura::Window> w3(CreateTestWindow());
1767 w3->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW);
1768 ::wm::AddTransientChild(w1.get(), w3.get());
1769 w3->Show();
1770 wm::ActivateWindow(w3.get());
1771
1772 wm::WorkspaceWindowState window_state =
1773 RootWindowController::ForWindow(GetShelfWidget()->GetNativeWindow())
1774 ->GetWorkspaceWindowState();
1775 EXPECT_EQ(wm::WORKSPACE_WINDOW_STATE_MAXIMIZED, window_state);
1776
1777 w3.reset();
1764 w1.reset(); 1778 w1.reset();
1765 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); 1779 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType());
1766 } 1780 }
1767 1781
1768 // Verify that the shelf doesn't have the opaque background if it's auto-hide 1782 // Verify that the shelf doesn't have the opaque background if it's auto-hide
1769 // status. 1783 // status.
1770 TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) { 1784 TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
1771 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); 1785 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType());
1772 1786
1773 GetPrimaryShelf()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 1787 GetPrimaryShelf()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 // Open keyboard in sticky mode. 1986 // Open keyboard in sticky mode.
1973 kb_controller->ShowKeyboard(true); 1987 kb_controller->ShowKeyboard(true);
1974 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); 1988 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds());
1975 1989
1976 // Work area should be changed. 1990 // Work area should be changed.
1977 EXPECT_NE(orig_work_area, 1991 EXPECT_NE(orig_work_area,
1978 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); 1992 display::Screen::GetScreen()->GetPrimaryDisplay().work_area());
1979 } 1993 }
1980 1994
1981 } // namespace ash 1995 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/focus_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698