| Index: ash/wm/screen_pinning_controller_unittest.cc
|
| diff --git a/ash/wm/screen_pinning_controller_unittest.cc b/ash/wm/screen_pinning_controller_unittest.cc
|
| index c5334a67e80a6a9b8859ae967498543f5374a6f8..a29fb3ce45dc63262fc4a87852dd4d785f16eaa5 100644
|
| --- a/ash/wm/screen_pinning_controller_unittest.cc
|
| +++ b/ash/wm/screen_pinning_controller_unittest.cc
|
| @@ -7,6 +7,7 @@
|
| #include <vector>
|
|
|
| #include "ash/aura/wm_window_aura.h"
|
| +#include "ash/common/accelerators/accelerator_controller.h"
|
| #include "ash/common/wm/window_state.h"
|
| #include "ash/common/wm/wm_event.h"
|
| #include "ash/common/wm_shell.h"
|
| @@ -33,7 +34,7 @@ TEST_F(ScreenPinningControllerTest, IsPinned) {
|
| aura::Window* w1 = CreateTestWindowInShellWithId(0);
|
| wm::ActivateWindow(w1);
|
|
|
| - wm::PinWindow(w1);
|
| + wm::PinWindow(w1, /* trusted */ false);
|
| EXPECT_TRUE(WmShell::Get()->IsPinned());
|
| }
|
|
|
| @@ -42,12 +43,12 @@ TEST_F(ScreenPinningControllerTest, OnlyOnePinnedWindow) {
|
| aura::Window* w2 = CreateTestWindowInShellWithId(1);
|
| wm::ActivateWindow(w1);
|
|
|
| - wm::PinWindow(w1);
|
| + wm::PinWindow(w1, /* trusted */ false);
|
| EXPECT_TRUE(WmWindowAura::Get(w1)->GetWindowState()->IsPinned());
|
| EXPECT_FALSE(WmWindowAura::Get(w2)->GetWindowState()->IsPinned());
|
|
|
| // Prohibit to pin two (or more) windows.
|
| - wm::PinWindow(w2);
|
| + wm::PinWindow(w2, /* trusted */ false);
|
| EXPECT_TRUE(WmWindowAura::Get(w1)->GetWindowState()->IsPinned());
|
| EXPECT_FALSE(WmWindowAura::Get(w2)->GetWindowState()->IsPinned());
|
| }
|
| @@ -57,7 +58,7 @@ TEST_F(ScreenPinningControllerTest, FullscreenInPinnedMode) {
|
| aura::Window* w2 = CreateTestWindowInShellWithId(1);
|
| wm::ActivateWindow(w1);
|
|
|
| - wm::PinWindow(w1);
|
| + wm::PinWindow(w1, /* trusted */ false);
|
| {
|
| // Window w1 should be in front of w2.
|
| std::vector<aura::Window*> siblings = w1->parent()->children();
|
| @@ -152,4 +153,17 @@ TEST_F(ScreenPinningControllerTest, FullscreenInPinnedMode) {
|
| }
|
| }
|
|
|
| +TEST_F(ScreenPinningControllerTest, TrustedPinnedWithAccelerator) {
|
| + aura::Window* w1 = CreateTestWindowInShellWithId(0);
|
| + wm::ActivateWindow(w1);
|
| +
|
| + wm::PinWindow(w1, /* trusted */ true);
|
| + EXPECT_TRUE(WmShell::Get()->IsPinned());
|
| +
|
| + WmShell::Get()->accelerator_controller()->PerformActionIfEnabled(UNPIN);
|
| + // The UNPIN accelerator key is disabled for trusted pinned and the window
|
| + // must be still pinned.
|
| + EXPECT_TRUE(WmShell::Get()->IsPinned());
|
| +}
|
| +
|
| } // namespace ash
|
|
|