OLD | NEW |
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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 end.set_y(start.y() + 100); | 943 end.set_y(start.y() + 100); |
944 generator.GestureScrollSequence(start, end, | 944 generator.GestureScrollSequence(start, end, |
945 base::TimeDelta::FromMilliseconds(10), 1); | 945 base::TimeDelta::FromMilliseconds(10), 1); |
946 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 946 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
947 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 947 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
948 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 948 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
949 EXPECT_EQ(bounds_noshelf.ToString(), window->bounds().ToString()); | 949 EXPECT_EQ(bounds_noshelf.ToString(), window->bounds().ToString()); |
950 EXPECT_EQ(shelf_hidden.ToString(), | 950 EXPECT_EQ(shelf_hidden.ToString(), |
951 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); | 951 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); |
952 | 952 |
953 // Swipe up yet again to show it. | |
954 end.set_y(start.y() + 100); | |
955 generator.GestureScrollSequence(end, start, | |
956 base::TimeDelta::FromMilliseconds(10), 1); | |
957 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); | |
958 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); | |
959 | |
960 // Tap on the shelf itself. This should not change anything. | |
961 generator.GestureTapAt(start); | |
962 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); | |
963 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); | |
964 | |
965 // Now, tap on the desktop region (above the shelf). This should hide the | |
966 // shelf. | |
967 gfx::Point tap = start + gfx::Vector2d(0, -90); | |
968 generator.GestureTapAt(tap); | |
969 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | |
970 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | |
971 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | |
972 | |
973 // Make the window fullscreen. | 953 // Make the window fullscreen. |
974 widget->SetFullscreen(true); | 954 widget->SetFullscreen(true); |
975 gfx::Rect bounds_fullscreen = window->bounds(); | 955 gfx::Rect bounds_fullscreen = window->bounds(); |
976 EXPECT_TRUE(widget->IsFullscreen()); | 956 EXPECT_TRUE(widget->IsFullscreen()); |
977 EXPECT_NE(bounds_noshelf.ToString(), bounds_fullscreen.ToString()); | 957 EXPECT_NE(bounds_noshelf.ToString(), bounds_fullscreen.ToString()); |
978 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 958 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
979 | 959 |
980 // Swipe-up. This should not change anything. | 960 // Swipe-up. This should not change anything. |
981 generator.GestureScrollSequence(end, start, | 961 generator.GestureScrollSequence(end, start, |
982 base::TimeDelta::FromMilliseconds(10), 1); | 962 base::TimeDelta::FromMilliseconds(10), 1); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | 1223 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
1244 } else { | 1224 } else { |
1245 EXPECT_FALSE(shelf->IsVisible()); | 1225 EXPECT_FALSE(shelf->IsVisible()); |
1246 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1226 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
1247 } | 1227 } |
1248 } | 1228 } |
1249 } | 1229 } |
1250 | 1230 |
1251 } // namespace internal | 1231 } // namespace internal |
1252 } // namespace ash | 1232 } // namespace ash |
OLD | NEW |