Chromium Code Reviews| Index: ash/wm/ash_focus_rules_unittest.cc |
| diff --git a/ash/wm/ash_focus_rules_unittest.cc b/ash/wm/ash_focus_rules_unittest.cc |
| index fe06fa47353ea0c704f7bbb0f03ba72b6159c6e9..968f8c8187adee0d76025e3319da4b2054ffb83e 100644 |
| --- a/ash/wm/ash_focus_rules_unittest.cc |
| +++ b/ash/wm/ash_focus_rules_unittest.cc |
| @@ -14,6 +14,7 @@ |
| #include "ash/wm/window_util.h" |
| #include "ui/aura/client/aura_constants.h" |
| #include "ui/aura/client/window_tree_client.h" |
| +#include "ui/views/test/widget_test.h" |
| #include "ui/views/view.h" |
| #include "ui/views/widget/widget.h" |
| @@ -186,5 +187,18 @@ TEST_F(LockScreenAshFocusRulesTest, RegainFocusAfterUnlock) { |
| EXPECT_TRUE(normal_window->HasFocus()); |
| } |
| +// Tests that a window doesn't get activated or focused if it shows up beneath |
| +// the lock screen. |
| +TEST_F(LockScreenAshFocusRulesTest, PreventFocusChangeWithLockScreenPresent) { |
|
sky
2016/03/02 03:41:02
Please add a test close to the code you are changi
xdai1
2016/03/02 21:15:55
I think it needs to be an ash test since it requir
sky
2016/03/02 22:09:09
The code you are changing is in NativeWidgetAura.
|
| + BlockUserSession(BLOCKED_BY_LOCK_SCREEN); |
| + EXPECT_TRUE(shell()->session_state_delegate()->IsScreenLocked()); |
| + |
| + views::test::TestInitialFocusWidgetDelegate delegate( |
| + shell()->GetPrimaryRootWindow()); |
| + EXPECT_FALSE(delegate.view()->HasFocus()); |
| + delegate.GetWidget()->Show(); |
| + EXPECT_FALSE(delegate.view()->HasFocus()); |
| +} |
| + |
| } // namespace test |
| } // namespace ash |