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

Unified Diff: ash/shell_unittest.cc

Issue 9630002: Ash: Remove compact window mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OpaqueBrowserFrameView, MultipleWindowIndicatorButton Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index a6791cecf15801a9f8985cbb717a6b84efd549d6..7777ef0c472752008a1ae6165db33ce063b93506 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -287,35 +287,6 @@ TEST_F(ShellTest, IsScreenLocked) {
EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
}
-TEST_F(ShellTest, ComputeWindowMode) {
- // By default, we use managed mode.
- Shell* shell = Shell::GetInstance();
- Shell::TestApi test_api(shell);
- CommandLine command_line_blank(CommandLine::NO_PROGRAM);
- EXPECT_EQ(Shell::MODE_MANAGED,
- test_api.ComputeWindowMode(&command_line_blank));
-
- // Sometimes we force compact mode.
- CommandLine command_line_force(CommandLine::NO_PROGRAM);
- command_line_force.AppendSwitch(switches::kAuraForceCompactWindowMode);
- EXPECT_EQ(Shell::MODE_COMPACT,
- test_api.ComputeWindowMode(&command_line_force));
-
- // The user can set compact mode.
- CommandLine command_line_compact(CommandLine::NO_PROGRAM);
- command_line_compact.AppendSwitchASCII(switches::kAuraWindowMode,
- switches::kAuraWindowModeCompact);
- EXPECT_EQ(Shell::MODE_COMPACT,
- test_api.ComputeWindowMode(&command_line_compact));
-
- // The user can set managed.
- CommandLine command_line_managed(CommandLine::NO_PROGRAM);
- command_line_managed.AppendSwitchASCII(switches::kAuraWindowMode,
- switches::kAuraWindowModeManaged);
- EXPECT_EQ(Shell::MODE_MANAGED,
- test_api.ComputeWindowMode(&command_line_managed));
-}
-
// Fails on Mac, see http://crbug.com/115662
#if defined(OS_MACOSX)
#define MAYBE_ManagedWindowModeBasics FAILS_ManagedWindowModeBasics
@@ -328,8 +299,6 @@ TEST_F(ShellTest, MAYBE_ManagedWindowModeBasics) {
// We start with the usual window containers.
ExpectAllContainers();
- // We're not in compact window mode by default.
- EXPECT_FALSE(shell->IsWindowModeCompact());
// We have a default container event filter (for window drags).
EXPECT_TRUE(GetDefaultContainer()->event_filter());
// Launcher is visible.
@@ -381,56 +350,4 @@ TEST_F(ShellTest, FullscreenWindowHidesShelf) {
widget->Close();
}
-// By implementing GetOverrideWindowMode we make the Shell come up in compact
-// window mode.
-class ShellCompactWindowModeTest : public test::AshTestBase {
- public:
- ShellCompactWindowModeTest() {}
- virtual ~ShellCompactWindowModeTest() {}
-
- protected:
- virtual bool GetOverrideWindowMode(Shell::WindowMode* window_mode) {
- *window_mode = Shell::MODE_COMPACT;
- return true;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShellCompactWindowModeTest);
-};
-
-TEST_F(ShellCompactWindowModeTest, CompactWindowModeBasics) {
- Shell* shell = Shell::GetInstance();
- Shell::TestApi test_api(shell);
-
- EXPECT_TRUE(shell->IsWindowModeCompact());
- // Compact mode does not use a default container event filter.
- EXPECT_FALSE(GetDefaultContainer()->event_filter());
- // We have all the usual containers.
- ExpectAllContainers();
-
- // Compact mode has no shelf.
- EXPECT_TRUE(shell->shelf() == NULL);
-
- // Create a window. In compact mode, windows are created maximized.
- views::Widget::InitParams widget_params(
- views::Widget::InitParams::TYPE_WINDOW);
- widget_params.bounds.SetRect(11, 22, 300, 400);
- widget_params.show_state = ui::SHOW_STATE_MAXIMIZED;
- views::Widget* widget = CreateTestWindow(widget_params);
- widget->Show();
-
- // Window bounds got updated to fill the work area.
- EXPECT_EQ(widget->GetWorkAreaBoundsInScreen(),
- widget->GetWindowScreenBounds());
- // Launcher is hidden.
- views::Widget* launcher_widget = shell->launcher()->widget();
- EXPECT_FALSE(launcher_widget->IsVisible());
- // Desktop background widget is gone but we have a layer.
- EXPECT_FALSE(test_api.root_window_layout()->background_widget());
- EXPECT_TRUE(test_api.root_window_layout()->background_layer());
-
- // Clean up.
- widget->Close();
-}
-
} // namespace ash
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698