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

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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 (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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include "ash/accelerators/accelerator_table.h" 7 #include "ash/accelerators/accelerator_table.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 639 }
640 640
641 TEST_F(AcceleratorControllerTest, CenterWindowAccelerator) { 641 TEST_F(AcceleratorControllerTest, CenterWindowAccelerator) {
642 scoped_ptr<aura::Window> window( 642 scoped_ptr<aura::Window> window(
643 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); 643 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
644 wm::WindowState* window_state = wm::GetWindowState(window.get()); 644 wm::WindowState* window_state = wm::GetWindowState(window.get());
645 window_state->Activate(); 645 window_state->Activate();
646 646
647 // Center the window using accelerator. 647 // Center the window using accelerator.
648 GetController()->PerformActionIfEnabled(WINDOW_POSITION_CENTER); 648 GetController()->PerformActionIfEnabled(WINDOW_POSITION_CENTER);
649 gfx::Rect work_area = 649 gfx::Rect work_area = gfx::Screen::GetScreen()
650 Shell::GetScreen()->GetDisplayNearestWindow(window.get()).work_area(); 650 ->GetDisplayNearestWindow(window.get())
651 .work_area();
651 gfx::Rect bounds = window->GetBoundsInScreen(); 652 gfx::Rect bounds = window->GetBoundsInScreen();
652 EXPECT_NEAR(bounds.x() - work_area.x(), 653 EXPECT_NEAR(bounds.x() - work_area.x(),
653 work_area.right() - bounds.right(), 654 work_area.right() - bounds.right(),
654 1); 655 1);
655 EXPECT_NEAR(bounds.y() - work_area.y(), 656 EXPECT_NEAR(bounds.y() - work_area.y(),
656 work_area.bottom() - bounds.bottom(), 657 work_area.bottom() - bounds.bottom(),
657 1); 658 1);
658 659
659 // Add the window to docked container and try to center it. 660 // Add the window to docked container and try to center it.
660 window->SetBounds(gfx::Rect(0, 0, 20, 20)); 661 window->SetBounds(gfx::Rect(0, 0, 20, 20));
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 EXPECT_TRUE(IsMessageCenterEmpty()); 1575 EXPECT_TRUE(IsMessageCenterEmpty());
1575 1576
1576 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1577 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1577 // screen before we proceed testing the rest of accelerators. 1578 // screen before we proceed testing the rest of accelerators.
1578 ResetStateIfNeeded(); 1579 ResetStateIfNeeded();
1579 } 1580 }
1580 } 1581 }
1581 #endif // defined(OS_CHROMEOS) 1582 #endif // defined(OS_CHROMEOS)
1582 1583
1583 } // namespace ash 1584 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/content/keyboard_overlay/keyboard_overlay_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698