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

Unified Diff: ash/wm/screen_pinning_controller_unittest.cc

Issue 2285633002: Add WM_EVENT_TRUSTED_PIN and WINDOW_STATE_TYPE_TRUSTED_PINNED to Ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/lock_window_state.cc ('k') | ash/wm/window_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/wm/lock_window_state.cc ('k') | ash/wm/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698