Chromium Code Reviews| Index: ash/accelerators/accelerator_controller_unittest.cc |
| diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc |
| index 4d8c8ff3e9d64d0f4fbb80461484bddd96e58dd5..0008d3e9ad7bcbbe803595d15083ca30809d74aa 100644 |
| --- a/ash/accelerators/accelerator_controller_unittest.cc |
| +++ b/ash/accelerators/accelerator_controller_unittest.cc |
| @@ -1020,5 +1020,36 @@ TEST_F(AcceleratorControllerTest, ReservedAccelerators) { |
| ui::Accelerator(ui::VKEY_A, ui::EF_NONE))); |
| } |
| +TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) { |
| + std::set<AcceleratorAction> allActions; |
| + for (size_t i = 0 ; i < kAcceleratorDataLength; ++i) { |
| + allActions.insert(kAcceleratorData[i].action); |
| + } |
| + std::set<AcceleratorAction> actionsAllowedAtModalWindow; |
| + for (size_t k = 0 ; k < kActionsAllowedAtModalWindowLength; ++k) { |
| + actionsAllowedAtModalWindow.insert(kActionsAllowedAtModalWindow[k]); |
| + } |
| + for (std::set<AcceleratorAction>::const_iterator it = |
| + actionsAllowedAtModalWindow.begin(); |
| + it != actionsAllowedAtModalWindow.end(); ++it) { |
| + EXPECT_FALSE(allActions.find(*it) == allActions.end()) |
| + << " action from kActionsAllowedAtModalWindow" |
| + << " not found in kAcceleratorData. action: " << *it; |
| + } |
| + scoped_ptr<aura::Window> window( |
| + aura::test::CreateTestWindowWithBounds(gfx::Rect(5, 5, 20, 20), NULL)); |
| + const ui::Accelerator dummy; |
| + wm::ActivateWindow(window.get()); |
| + Shell::GetInstance()->SimulateModalWindowOpenForTesting(true); |
| + for (std::set<AcceleratorAction>::const_iterator it = allActions.begin(); |
| + it != allActions.end(); ++it) { |
| + if (actionsAllowedAtModalWindow.find(*it) == |
| + actionsAllowedAtModalWindow.end()) { |
| + EXPECT_TRUE(GetController()->PerformAction(*it, dummy)) |
|
Yusuke Sato
2012/10/16 01:03:18
This test itself looks good to me, but I think it
sschmitz
2012/10/16 18:18:23
Done.
|
| + << " for action (disallowed at modal window): " << *it; |
| + } |
| + } |
| +} |
| + |
| } // namespace test |
| } // namespace ash |