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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc

Issue 2084503007: Moves WindowSelectorController onto WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_overview
Patch Set: fix mash Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/maximize_mode/maximize_mode_controller.h" 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/common/ash_switches.h" 11 #include "ash/common/ash_switches.h"
12 #include "ash/common/system/tray/system_tray_delegate.h" 12 #include "ash/common/system/tray/system_tray_delegate.h"
13 #include "ash/common/wm/overview/window_selector_controller.h" 13 #include "ash/common/wm/overview/window_selector_controller.h"
14 #include "ash/common/wm_shell.h"
14 #include "ash/display/display_manager.h" 15 #include "ash/display/display_manager.h"
15 #include "ash/shell.h" 16 #include "ash/shell.h"
16 #include "ash/test/ash_test_base.h" 17 #include "ash/test/ash_test_base.h"
17 #include "ash/test/display_manager_test_api.h" 18 #include "ash/test/display_manager_test_api.h"
18 #include "ash/test/test_system_tray_delegate.h" 19 #include "ash/test/test_system_tray_delegate.h"
19 #include "ash/test/test_volume_control_delegate.h" 20 #include "ash/test/test_volume_control_delegate.h"
20 #include "base/command_line.h" 21 #include "base/command_line.h"
21 #include "base/test/simple_test_tick_clock.h" 22 #include "base/test/simple_test_tick_clock.h"
22 #include "base/test/user_action_tester.h" 23 #include "base/test/user_action_tester.h"
23 #include "chromeos/accelerometer/accelerometer_reader.h" 24 #include "chromeos/accelerometer/accelerometer_reader.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return; 470 return;
470 471
471 UpdateDisplay("800x600,800x600"); 472 UpdateDisplay("800x600,800x600");
472 std::unique_ptr<aura::Window> w1( 473 std::unique_ptr<aura::Window> w1(
473 CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 100, 100))); 474 CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 100, 100)));
474 std::unique_ptr<aura::Window> w2( 475 std::unique_ptr<aura::Window> w2(
475 CreateTestWindowInShellWithBounds(gfx::Rect(800, 0, 100, 100))); 476 CreateTestWindowInShellWithBounds(gfx::Rect(800, 0, 100, 100)));
476 ASSERT_NE(w1->GetRootWindow(), w2->GetRootWindow()); 477 ASSERT_NE(w1->GetRootWindow(), w2->GetRootWindow());
477 478
478 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); 479 maximize_mode_controller()->EnableMaximizeModeWindowManager(true);
479 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); 480 WmShell::Get()->window_selector_controller()->ToggleOverview();
480 481
481 UpdateDisplay("800x600"); 482 UpdateDisplay("800x600");
482 EXPECT_FALSE( 483 EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
483 Shell::GetInstance()->window_selector_controller()->IsSelecting());
484 EXPECT_EQ(w1->GetRootWindow(), w2->GetRootWindow()); 484 EXPECT_EQ(w1->GetRootWindow(), w2->GetRootWindow());
485 } 485 }
486 486
487 // Test that the disabling of the internal display exits maximize mode, and that 487 // Test that the disabling of the internal display exits maximize mode, and that
488 // while disabled we do not re-enter maximize mode. 488 // while disabled we do not re-enter maximize mode.
489 TEST_F(MaximizeModeControllerTest, NoMaximizeModeWithDisabledInternalDisplay) { 489 TEST_F(MaximizeModeControllerTest, NoMaximizeModeWithDisabledInternalDisplay) {
490 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 490 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
491 UpdateDisplay("200x200, 200x200"); 491 UpdateDisplay("200x200, 200x200");
492 const int64_t internal_display_id = 492 const int64_t internal_display_id =
493 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); 493 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // accelerometer updates which would normally cause it to exit do not. 529 // accelerometer updates which would normally cause it to exit do not.
530 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { 530 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) {
531 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); 531 maximize_mode_controller()->EnableMaximizeModeWindowManager(true);
532 532
533 // Would normally trigger an exit from maximize mode. 533 // Would normally trigger an exit from maximize mode.
534 OpenLidToAngle(90.0f); 534 OpenLidToAngle(90.0f);
535 EXPECT_TRUE(IsMaximizeModeStarted()); 535 EXPECT_TRUE(IsMaximizeModeStarted());
536 } 536 }
537 537
538 } // namespace ash 538 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/gestures/overview_gesture_handler_unittest.cc ('k') | ash/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698