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

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

Issue 247363005: Fullscreen/immersive mode is allowed in touch view mode, the shelf gets hidden and an edge swipe br… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 // remain fullscreen. 1563 // remain fullscreen.
1564 EXPECT_TRUE(widget->IsFullscreen()); 1564 EXPECT_TRUE(widget->IsFullscreen());
1565 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); 1565 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1566 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); 1566 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1567 generator.GestureEdgeSwipe(); 1567 generator.GestureEdgeSwipe();
1568 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); 1568 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1569 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); 1569 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1570 EXPECT_TRUE(widget->IsFullscreen()); 1570 EXPECT_TRUE(widget->IsFullscreen());
1571 } 1571 }
1572 1572
1573 // Test that starting the maximize mode does still allow the shelf to be made
1574 // visible when an (immersive mode) full screen app is running.
1575 TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipeInMaximizeMode) {
1576 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1577 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
1578 views::Widget* widget = new views::Widget;
1579 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
1580 params.bounds = gfx::Rect(0, 0, 200, 200);
1581 params.context = CurrentContext();
1582 widget->Init(params);
1583 widget->Show();
1584 aura::Window* window = widget->GetNativeWindow();
1585 wm::GetWindowState(window)->set_hide_shelf_when_fullscreen(false);
1586 widget->SetFullscreen(true);
1587
1588 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
1589
1590 // The maximize mode gets started.
1591 shelf->OnMaximizeModeStarted();
1592 shelf->LayoutShelf();
1593 shelf->UpdateVisibilityState();
1594
1595 // Edge swipe in fullscreen + AUTO_HIDE_HIDDEN should show the shelf and
1596 // remain fullscreen.
1597 EXPECT_TRUE(widget->IsFullscreen());
1598 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1599 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
1600 generator.GestureEdgeSwipe();
1601 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
1602 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
1603 EXPECT_TRUE(widget->IsFullscreen());
1604 }
1605
1573 // Check that in maximize mode gesture swipes on the shelf have no effect. 1606 // Check that in maximize mode gesture swipes on the shelf have no effect.
1574 TEST_F(ShelfLayoutManagerTest, MaximizeModeGestureEdgeSwipe) { 1607 TEST_F(ShelfLayoutManagerTest, MaximizeModeGestureEdgeSwipe) {
1575 ShelfLayoutManager* shelf = GetShelfLayoutManager(); 1608 ShelfLayoutManager* shelf = GetShelfLayoutManager();
1576 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 1609 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
1577 views::Widget* widget = new views::Widget; 1610 views::Widget* widget = new views::Widget;
1578 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 1611 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
1579 params.bounds = gfx::Rect(0, 0, 200, 200); 1612 params.bounds = gfx::Rect(0, 0, 200, 200);
1580 params.context = CurrentContext(); 1613 params.context = CurrentContext();
1581 widget->Init(params); 1614 widget->Init(params);
1582 widget->Show(); 1615 widget->Show();
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 generator.MoveMouseTo(0, 399); 2085 generator.MoveMouseTo(0, 399);
2053 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); 2086 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
2054 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 2087 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
2055 generator.ClickLeftButton(); 2088 generator.ClickLeftButton();
2056 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); 2089 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
2057 generator.ClickLeftButton(); 2090 generator.ClickLeftButton();
2058 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 2091 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
2059 } 2092 }
2060 2093
2061 } // namespace ash 2094 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698