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

Side by Side 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: Fix linux build breakage 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/wm/workspace/workspace_layout_manager.h" 5 #include "ash/common/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/aura/wm_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 fullscreen_window->SetProperty(aura::client::kShowStateKey, 669 fullscreen_window->SetProperty(aura::client::kShowStateKey,
670 ui::SHOW_STATE_NORMAL); 670 ui::SHOW_STATE_NORMAL);
671 EXPECT_TRUE( 671 EXPECT_TRUE(
672 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey)); 672 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
673 EXPECT_TRUE( 673 EXPECT_TRUE(
674 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey)); 674 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
675 EXPECT_EQ(nullptr, GetRootWindowController(fullscreen_window->GetRootWindow()) 675 EXPECT_EQ(nullptr, GetRootWindowController(fullscreen_window->GetRootWindow())
676 ->GetWindowForFullscreenMode()); 676 ->GetWindowForFullscreenMode());
677 } 677 }
678 678
679 // Similary, pinned window causes always_on_top_ windows to stack below.
680 TEST_F(WorkspaceLayoutManagerSoloTest, PinnedSuspendsAlwaysOnTop) {
681 gfx::Rect bounds(100, 100, 200, 200);
682 std::unique_ptr<aura::Window> pinned_window(CreateTestWindow(bounds));
683 std::unique_ptr<aura::Window> always_on_top_window1(CreateTestWindow(bounds));
684 std::unique_ptr<aura::Window> always_on_top_window2(CreateTestWindow(bounds));
685 always_on_top_window1->SetProperty(aura::client::kAlwaysOnTopKey, true);
686 always_on_top_window2->SetProperty(aura::client::kAlwaysOnTopKey, true);
687
688 // Making a window pinned temporarily suspends always on top state.
689 wm::PinWindow(pinned_window.get());
690 EXPECT_FALSE(
691 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
692 EXPECT_FALSE(
693 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
694
695 // Making pinned window normal restores always on top windows.
696 WmWindowAura::Get(pinned_window.get())->GetWindowState()->Restore();
697 EXPECT_TRUE(
698 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
699 EXPECT_TRUE(
700 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
701 }
702
679 // Tests fullscreen window size during root window resize. 703 // Tests fullscreen window size during root window resize.
680 TEST_F(WorkspaceLayoutManagerSoloTest, FullscreenRootWindowResize) { 704 TEST_F(WorkspaceLayoutManagerSoloTest, FullscreenRootWindowResize) {
681 gfx::Rect bounds(100, 100, 200, 200); 705 gfx::Rect bounds(100, 100, 200, 200);
682 std::unique_ptr<aura::Window> window(CreateTestWindow(bounds)); 706 std::unique_ptr<aura::Window> window(CreateTestWindow(bounds));
683 // Fullscreen window fills the whole display. 707 // Fullscreen window fills the whole display.
684 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 708 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
685 EXPECT_EQ(display::Screen::GetScreen() 709 EXPECT_EQ(display::Screen::GetScreen()
686 ->GetDisplayNearestWindow(window.get()) 710 ->GetDisplayNearestWindow(window.get())
687 .bounds() 711 .bounds()
688 .ToString(), 712 .ToString(),
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 EXPECT_EQ(gfx::Rect(50, 1176 EXPECT_EQ(gfx::Rect(50,
1153 keyboard_bounds.y() - keyboard_bounds.height()/2, 1177 keyboard_bounds.y() - keyboard_bounds.height()/2,
1154 occluded_window_bounds.width(), 1178 occluded_window_bounds.width(),
1155 occluded_window_bounds.height()).ToString(), 1179 occluded_window_bounds.height()).ToString(),
1156 window->bounds().ToString()); 1180 window->bounds().ToString());
1157 HideKeyboard(); 1181 HideKeyboard();
1158 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); 1182 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString());
1159 } 1183 }
1160 1184
1161 } // namespace ash 1185 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698