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

Side by Side Diff: ash/shell_unittest.cc

Issue 9513004: Switch default WM mode to managed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/root_window_event_filter_unittest.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/ash_switches.h" 5 #include "ash/ash_switches.h"
6 #include "ash/launcher/launcher.h" 6 #include "ash/launcher/launcher.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/root_window_layout_manager.h" 10 #include "ash/wm/root_window_layout_manager.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked()); 281 EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
282 lock_widget->Show(); 282 lock_widget->Show();
283 EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked()); 283 EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
284 lock_modal_widget->Close(); 284 lock_modal_widget->Close();
285 EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked()); 285 EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
286 lock_widget->Close(); 286 lock_widget->Close();
287 EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked()); 287 EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
288 } 288 }
289 289
290 TEST_F(ShellTest, ComputeWindowMode) { 290 TEST_F(ShellTest, ComputeWindowMode) {
291 // By default, we use overlapping mode. 291 // By default, we use managed mode.
292 Shell* shell = Shell::GetInstance(); 292 Shell* shell = Shell::GetInstance();
293 Shell::TestApi test_api(shell); 293 Shell::TestApi test_api(shell);
294 CommandLine command_line_blank(CommandLine::NO_PROGRAM); 294 CommandLine command_line_blank(CommandLine::NO_PROGRAM);
295 EXPECT_EQ(Shell::MODE_OVERLAPPING, 295 EXPECT_EQ(Shell::MODE_MANAGED,
296 test_api.ComputeWindowMode(&command_line_blank)); 296 test_api.ComputeWindowMode(&command_line_blank));
297 297
298 // Sometimes we force compact mode. 298 // Sometimes we force compact mode.
299 CommandLine command_line_force(CommandLine::NO_PROGRAM); 299 CommandLine command_line_force(CommandLine::NO_PROGRAM);
300 command_line_force.AppendSwitch(switches::kAuraForceCompactWindowMode); 300 command_line_force.AppendSwitch(switches::kAuraForceCompactWindowMode);
301 EXPECT_EQ(Shell::MODE_COMPACT, 301 EXPECT_EQ(Shell::MODE_COMPACT,
302 test_api.ComputeWindowMode(&command_line_force)); 302 test_api.ComputeWindowMode(&command_line_force));
303 303
304 // The user can set overlapping mode.
305 CommandLine command_line_overlapping(CommandLine::NO_PROGRAM);
306 command_line_overlapping.AppendSwitchASCII(
307 switches::kAuraWindowMode,
308 switches::kAuraWindowModeOverlapping);
309 EXPECT_EQ(Shell::MODE_OVERLAPPING,
310 test_api.ComputeWindowMode(&command_line_overlapping));
311
304 // The user can set compact mode. 312 // The user can set compact mode.
305 CommandLine command_line_compact(CommandLine::NO_PROGRAM); 313 CommandLine command_line_compact(CommandLine::NO_PROGRAM);
306 command_line_compact.AppendSwitchASCII(switches::kAuraWindowMode, 314 command_line_compact.AppendSwitchASCII(switches::kAuraWindowMode,
307 switches::kAuraWindowModeCompact); 315 switches::kAuraWindowModeCompact);
308 EXPECT_EQ(Shell::MODE_COMPACT, 316 EXPECT_EQ(Shell::MODE_COMPACT,
309 test_api.ComputeWindowMode(&command_line_compact)); 317 test_api.ComputeWindowMode(&command_line_compact));
310 318
311 // The user can set managed. 319 // The user can set managed.
312 CommandLine command_line_managed(CommandLine::NO_PROGRAM); 320 CommandLine command_line_managed(CommandLine::NO_PROGRAM);
313 command_line_managed.AppendSwitchASCII(switches::kAuraWindowMode, 321 command_line_managed.AppendSwitchASCII(switches::kAuraWindowMode,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 EXPECT_FALSE(launcher_widget->IsVisible()); 441 EXPECT_FALSE(launcher_widget->IsVisible());
434 // Desktop background widget is gone but we have a layer. 442 // Desktop background widget is gone but we have a layer.
435 EXPECT_FALSE(test_api.root_window_layout()->background_widget()); 443 EXPECT_FALSE(test_api.root_window_layout()->background_widget());
436 EXPECT_TRUE(test_api.root_window_layout()->background_layer()); 444 EXPECT_TRUE(test_api.root_window_layout()->background_layer());
437 445
438 // Clean up. 446 // Clean up.
439 widget->Close(); 447 widget->Close();
440 } 448 }
441 449
442 } // namespace ash 450 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/root_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698