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

Unified Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: ash/wm/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index aab232016ce6b1e2eb7d925478b8ef368683d7b8..1331522b0ea804f3719e74e1a45fd0b21d4aa211 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -676,6 +676,30 @@ TEST_F(WorkspaceLayoutManagerSoloTest, FullscreenSuspendsAlwaysOnTop) {
->GetWindowForFullscreenMode());
}
+// Similary, pinned window causes always_on_top_ windows to stack below.
+TEST_F(WorkspaceLayoutManagerSoloTest, PinnedSuspendsAlwaysOnTop) {
+ gfx::Rect bounds(100, 100, 200, 200);
+ std::unique_ptr<aura::Window> pinned_window(CreateTestWindow(bounds));
+ std::unique_ptr<aura::Window> always_on_top_window1(CreateTestWindow(bounds));
+ std::unique_ptr<aura::Window> always_on_top_window2(CreateTestWindow(bounds));
+ always_on_top_window1->SetProperty(aura::client::kAlwaysOnTopKey, true);
+ always_on_top_window2->SetProperty(aura::client::kAlwaysOnTopKey, true);
+
+ // Making a window pinned temporarily suspends always on top state.
+ wm::PinWindow(pinned_window.get());
+ EXPECT_FALSE(
+ always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
+ EXPECT_FALSE(
+ always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
+
+ // Making pinned window normal restores always on top windows.
+ WmWindowAura::Get(pinned_window.get())->GetWindowState()->Restore();
+ EXPECT_TRUE(
+ always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
+ EXPECT_TRUE(
+ always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
+}
+
// Tests fullscreen window size during root window resize.
TEST_F(WorkspaceLayoutManagerSoloTest, FullscreenRootWindowResize) {
gfx::Rect bounds(100, 100, 200, 200);

Powered by Google App Engine
This is Rietveld 408576698