Home | History | Annotate | Download | only in shelf

Lines Matching defs:shelf

5 #include "ash/shelf/shelf_layout_manager.h"
18 #include "ash/shelf/shelf_layout_manager_observer.h"
19 #include "ash/shelf/shelf_widget.h"
62 return Shell::GetPrimaryRootWindowController()->shelf();
95 // The state of the shelf at the end of the gesture is tested separately.
116 // if the shelf is being dimmed test dimmer bounds as well.
121 // The shelf should never be smaller than the hidden state.
143 // If dragging inwards from the visible state, then the shelf should
150 // If dragging outwards from the visible state, then the shelf
158 // Tests that the shelf sticks with the touch point during the drag
159 // until the shelf is completely visible.
162 // Tests that after the shelf is completely visible, the shelf starts
276 void SetState(ShelfLayoutManager* shelf,
278 shelf->SetState(state);
325 ShelfLayoutManager* shelf = GetShelfLayoutManager();
326 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
336 shelf->LayoutShelf();
340 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
342 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
343 shelf->LayoutShelf();
344 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
349 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
350 shelf->LayoutShelf();
356 // Swipe up on the shelf. This should not change any state.
360 // Swipe down on the shelf to hide it.
365 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
366 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
367 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
372 // Swipe up to show the shelf.
377 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
378 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
385 // Swipe up again. The shelf should hide.
391 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
392 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
393 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
415 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
416 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
427 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
428 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
429 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
449 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
450 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
463 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
464 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
465 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
481 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
482 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
483 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
487 // Swipe up from below the shelf where a bezel would be, this should show the
488 // shelf.
502 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
503 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
516 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
517 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
518 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
527 shelf->UpdateVisibilityState();
533 // Swipe up. This should show the shelf.
539 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
540 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
541 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
546 // Swipe up again. This should hide the shelf.
551 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
552 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
553 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
561 shelf->UpdateVisibilityState();
562 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
563 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
571 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
572 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
580 // The shelf should be shown because there are no more visible windows.
581 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
582 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
583 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
592 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
593 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
594 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
605 ShelfWidget* shelf = GetShelfWidget();
606 ShelfLayoutManager* manager = shelf->shelf_layout_manager();
612 shelf->status_area_widget()->GetWindowBoundsInScreen());
614 shelf->GetWindowBoundsInScreen());
623 // Hide the shelf.
626 StepWidgetLayerAnimatorToEnd(shelf);
627 StepWidgetLayerAnimatorToEnd(shelf->status_area_widget());
635 EXPECT_GE(shelf->GetNativeView()->bounds().y(),
637 EXPECT_GE(shelf->status_area_widget()->GetNativeView()->bounds().y(),
643 StepWidgetLayerAnimatorToEnd(shelf);
644 StepWidgetLayerAnimatorToEnd(shelf->status_area_widget());
651 launcher_bounds = shelf->GetNativeView()->bounds();
657 status_bounds = shelf->status_area_widget()->GetNativeView()->bounds();
664 ShelfWidget* shelf = GetShelfWidget();
666 shelf->shelf_layout_manager()->LayoutShelf();
667 EXPECT_EQ(SHELF_VISIBLE, shelf->shelf_layout_manager()->visibility_state());
669 // Hide the shelf.
670 SetState(shelf->shelf_layout_manager(), SHELF_HIDDEN);
671 shelf->shelf_layout_manager()->LayoutShelf();
672 EXPECT_EQ(SHELF_HIDDEN, shelf->shelf_layout_manager()->visibility_state());
678 EXPECT_GE(shelf->GetNativeView()->bounds().y(),
680 EXPECT_GE(shelf->status_area_widget()->GetNativeView()->bounds().y(),
685 // shelf show / hide animation if it is already running. (crbug.com/250918)
687 ShelfWidget* shelf = GetShelfWidget();
688 SetState(shelf->shelf_layout_manager(), SHELF_VISIBLE);
689 gfx::Rect initial_shelf_bounds = shelf->GetWindowBoundsInScreen();
691 shelf->status_area_widget()->GetWindowBoundsInScreen();
695 SetState(shelf->shelf_layout_manager(), SHELF_HIDDEN);
696 SetState(shelf->shelf_layout_manager(), SHELF_VISIBLE);
698 gfx::Rect current_shelf_bounds = shelf->GetWindowBoundsInScreen();
700 shelf->status_area_widget()->GetWindowBoundsInScreen();
738 ShelfLayoutManager* shelf = GetShelfLayoutManager();
739 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
748 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
749 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
753 shelf->LayoutShelf();
763 // Shelf should be shown again (but it shouldn't have changed the work area).
764 SetState(shelf, SHELF_AUTO_HIDE);
765 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
766 shelf->LayoutShelf();
767 EXPECT_EQ(root->bounds().bottom() - shelf->GetIdealBounds().height(),
775 SetState(shelf, SHELF_AUTO_HIDE);
776 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
777 shelf->LayoutShelf();
785 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
790 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
794 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
797 // Test the behavior of the shelf when it is auto hidden and it is on the
807 // Put the primary monitor's shelf on the display boundary.
808 ShelfLayoutManager* shelf = GetShelfLayoutManager();
809 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
811 // Create a window because the shelf is always shown when no windows are
819 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
820 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
825 // Start off the mouse nowhere near the shelf; the shelf should be hidden.
829 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
832 // should show the shelf.
835 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
838 // Moving the mouse off the light bar should hide the shelf.
841 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
844 // should show the shelf despite the mouse cursor getting warped to the
850 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
852 // Hide the shelf.
855 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
858 // overshooting by a lot should keep the shelf hidden.
862 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
865 // overshooting a bit should show the shelf.
869 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
872 // shelf is shown should keep the shelf shown.
875 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
878 // hide the shelf.
881 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
884 // the primary display's right aligned shelf first should not show the shelf.
887 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
893 // it isn't over the shelf.
898 ShelfLayoutManager* shelf = GetShelfLayoutManager();
899 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
908 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
909 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
914 shelf->LayoutShelf();
935 shelf->UpdateVisibilityState();
936 // Showing a widget in the lock screen should force the shelf to be visibile.
937 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
940 shelf->UpdateVisibilityState();
941 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
947 // it isn't over the shelf.
952 ShelfLayoutManager* shelf = GetShelfLayoutManager();
964 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
965 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
967 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
968 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
971 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
976 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
977 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
982 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
983 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
989 // Basic assertions around the dimming of the shelf.
992 // it isn't over the shelf.
997 ShelfLayoutManager* shelf = GetShelfLayoutManager();
998 shelf->shelf_widget()->DisableDimmingAnimationsForTest();
1013 shelf->shelf_widget()->GetWindowBoundsInScreen().CenterPoint();
1017 EXPECT_EQ(-1, shelf->shelf_widget()->GetDimmingAlphaForTest());
1019 EXPECT_EQ(-1, shelf->shelf_widget()->GetDimmingAlphaForTest());
1021 // After maximization, the shelf should be visible and the dimmer created.
1024 on_shelf = shelf->shelf_widget()->GetWindowBoundsInScreen().CenterPoint();
1025 EXPECT_LT(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1027 // Moving the mouse off the shelf should dim the bar.
1029 EXPECT_LT(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1031 // Adding touch events outside the shelf should still keep the shelf in
1035 EXPECT_LT(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1036 // Move the touch into the shelf area should undim.
1038 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1041 EXPECT_LT(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1043 // Moving the mouse on the shelf should undim the bar.
1045 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1047 // No matter what the touch events do, the shelf should stay undimmed.
1050 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1052 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1054 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1060 EXPECT_EQ(-1, shelf->shelf_widget()->GetDimmingAlphaForTest());
1063 // Assertions around the dimming of the shelf in conjunction with menus.
1066 // it isn't over the shelf.
1071 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1072 shelf->shelf_widget()->DisableDimmingAnimationsForTest();
1085 // After maximization, the shelf should be visible and the dimmer created.
1090 shelf->shelf_widget()->GetWindowBoundsInScreen().CenterPoint();
1092 // Moving the mouse on the shelf should undim the bar.
1094 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1097 shelf->shelf_widget()->ForceUndimming(true);
1099 // Moving the mouse off the shelf should not dim the bar.
1101 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1103 // No matter what the touch events do, the shelf should stay undimmed.
1106 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1108 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1110 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1112 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1115 // the shelf any longer.
1116 shelf->shelf_widget()->ForceUndimming(false);
1117 EXPECT_LT(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1119 // Moving the mouse again on the shelf which should undim the bar again.
1123 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1124 shelf->shelf_widget()->ForceUndimming(true);
1126 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1128 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1129 shelf->shelf_widget()->ForceUndimming(true);
1130 EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
1133 // Verifies the shelf is visible when status/launcher is focused.
1136 // it isn't over the shelf.
1141 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1149 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1150 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1151 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1156 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1159 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1164 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1167 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1170 // Makes sure shelf will be visible when app list opens as shelf is in
1171 // SHELF_VISIBLE state,and toggling app list won't change shelf
1175 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1176 shelf->LayoutShelf();
1177 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1179 // Create a normal unmaximized windowm shelf should be visible.
1184 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
1186 // Toggle app list to show, and the shelf stays visible.
1189 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
1191 // Toggle app list to hide, and the shelf stays visible.
1194 shelf->visibility_state());
1197 // Makes sure shelf will be shown with SHELF_AUTO_HIDE_SHOWN state
1198 // when app list opens as shelf is in SHELF_AUTO_HIDE state, and
1199 // toggling app list won't change shelf visibility state.
1202 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1203 shelf->LayoutShelf();
1204 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1214 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1218 // The shelf's auto hide state won't be changed until the timer fires, so
1223 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1224 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1229 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1232 // Makes sure shelf will be hidden when app list opens as shelf is in HIDDEN
1233 // state, and toggling app list won't change shelf visibility state.
1236 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1237 // For shelf to be visible, app list is not open in initial state.
1238 shelf->LayoutShelf();
1247 // App list and shelf is not shown.
1249 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
1254 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
1259 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
1271 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1273 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1274 shelf->LayoutShelf();
1275 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
1277 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
1284 EXPECT_EQ(shelf->GetIdealBounds().width(),
1294 EXPECT_EQ(shelf->GetIdealBounds().width(),
1302 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1308 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1309 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
1314 EXPECT_EQ(shelf->GetIdealBounds().width(),
1322 EXPECT_EQ(shelf->GetIdealBounds().width(),
1330 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1337 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1338 shelf->SetAlignment(SHELF_ALIGNMENT_TOP);
1343 EXPECT_EQ(shelf->GetIdealBounds().height(),
1351 EXPECT_EQ(shelf->GetIdealBounds().height(),
1359 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1375 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1383 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
1389 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
1399 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1400 shelf->LayoutShelf();
1401 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1407 shelf->UpdateVisibilityState();
1408 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1412 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1416 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1423 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1427 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1430 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1434 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1438 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1441 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1444 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1455 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1456 shelf->LayoutShelf();
1464 // First, make sure the shelf is visible.
1465 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1486 // Now, hide the shelf.
1487 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1489 // Start a drag from the bezel, and drag up to show both the shelf and the
1495 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
1500 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1505 // Turn on auto-hide for the shelf.
1506 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1507 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1508 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1510 // Show the status menu. That should make the shelf visible again.
1513 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1514 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1518 // make sure the mouse does not alter the auto-hide state in the shelf).
1519 // This should not trigger any auto-hide state change in the shelf.
1521 shelf->AddObserver(&observer);
1527 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1528 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1531 shelf->RemoveObserver(&observer);
1535 // Make sure the shelf is always visible.
1536 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1537 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1538 shelf->LayoutShelf();
1556 // Now hide the shelf.
1557 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1559 // Both windows should be resized according to the shelf status.
1566 // Now show the shelf.
1567 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1576 // Confirm that the shelf is dimmed only when content is maximized and
1577 // shelf is not autohidden.
1584 // Normal window doesn't dim shelf.
1586 ShelfWidget* shelf = GetShelfWidget();
1587 EXPECT_FALSE(shelf->GetDimsShelf());
1591 EXPECT_TRUE(shelf->GetDimsShelf());
1595 EXPECT_FALSE(shelf->GetDimsShelf());
1599 EXPECT_TRUE(shelf->GetDimsShelf());
1601 // Changing shelf to autohide stops dimming.
1603 EXPECT_FALSE(shelf->GetDimsShelf());
1606 // Make sure that the shelf will not hide if the mouse is between a bubble and
1607 // the shelf.
1609 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1611 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
1617 shelf->LayoutShelf();
1621 // the shelf disappear and then with a message bubble which should keep it
1624 // Make sure the shelf is visible and position the mouse over it. Then
1626 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1631 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1632 EXPECT_TRUE(shelf->IsVisible());
1644 // Move the pointer over the edge of the shelf.
1647 shelf->UpdateVisibilityState();
1649 EXPECT_TRUE(shelf->IsVisible());
1652 EXPECT_FALSE(shelf->IsVisible());
1671 // Overlaps with shelf.
1688 // Verify that the shelf doesn't have the opaque background if it's auto-hide