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..955c4065089bf031fa2855b2c6f3c538d2e08308 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,15 @@ 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); |
+ EXPECT_TRUE(WmShell::Get()->IsPinned()); |
hidehiko
2016/08/29 14:31:39
Could you explicitly comment that the "no-unpin" i
hirono
2016/08/30 07:16:08
Done.
|
+} |
+ |
} // namespace ash |