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

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

Issue 1059903002: Allow Alt-Tab to move the focus to docked windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | ash/switchable_windows.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/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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 gfx::Rect bounds = window->GetBoundsInScreen(); 646 gfx::Rect bounds = window->GetBoundsInScreen();
647 EXPECT_NEAR(bounds.x() - work_area.x(), 647 EXPECT_NEAR(bounds.x() - work_area.x(),
648 work_area.right() - bounds.right(), 648 work_area.right() - bounds.right(),
649 1); 649 1);
650 EXPECT_NEAR(bounds.y() - work_area.y(), 650 EXPECT_NEAR(bounds.y() - work_area.y(),
651 work_area.bottom() - bounds.bottom(), 651 work_area.bottom() - bounds.bottom(),
652 1); 652 1);
653 653
654 // Add the window to docked container and try to center it. 654 // Add the window to docked container and try to center it.
655 window->SetBounds(gfx::Rect(0, 0, 20, 20)); 655 window->SetBounds(gfx::Rect(0, 0, 20, 20));
656 aura::Window* docked_container = Shell::GetContainer( 656 const wm::WMEvent event(wm::WM_EVENT_DOCK);
657 window->GetRootWindow(), kShellWindowId_DockedContainer); 657 wm::GetWindowState(window.get())->OnWMEvent(&event);
658 docked_container->AddChild(window.get()); 658 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
659
659 gfx::Rect docked_bounds = window->GetBoundsInScreen(); 660 gfx::Rect docked_bounds = window->GetBoundsInScreen();
660 GetController()->PerformActionIfEnabled(WINDOW_POSITION_CENTER); 661 GetController()->PerformActionIfEnabled(WINDOW_POSITION_CENTER);
661 // It should not get centered and should remain docked. 662 // It should not get centered and should remain docked.
662 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id()); 663 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
663 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString()); 664 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString());
664 } 665 }
665 666
666 TEST_F(AcceleratorControllerTest, AutoRepeat) { 667 TEST_F(AcceleratorControllerTest, AutoRepeat) {
667 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_CONTROL_DOWN); 668 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_CONTROL_DOWN);
668 accelerator_a.set_type(ui::ET_KEY_PRESSED); 669 accelerator_a.set_type(ui::ET_KEY_PRESSED);
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 wm::ActivateWindow(window.get()); 1408 wm::ActivateWindow(window.get());
1408 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE); 1409 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE);
1409 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE); 1410 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE);
1410 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]); 1411 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]);
1411 EXPECT_NE(delegate->GetLastAccessibilityAlert(), 1412 EXPECT_NE(delegate->GetLastAccessibilityAlert(),
1412 ui::A11Y_ALERT_WINDOW_NEEDED); 1413 ui::A11Y_ALERT_WINDOW_NEEDED);
1413 } 1414 }
1414 } 1415 }
1415 1416
1416 } // namespace ash 1417 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/switchable_windows.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698