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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager_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: Add comments. 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 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 // Similary, pinned window causes always_on_top_ windows to stack below. 692 // Similary, pinned window causes always_on_top_ windows to stack below.
693 TEST_F(WorkspaceLayoutManagerSoloTest, PinnedSuspendsAlwaysOnTop) { 693 TEST_F(WorkspaceLayoutManagerSoloTest, PinnedSuspendsAlwaysOnTop) {
694 gfx::Rect bounds(100, 100, 200, 200); 694 gfx::Rect bounds(100, 100, 200, 200);
695 std::unique_ptr<aura::Window> pinned_window(CreateTestWindow(bounds)); 695 std::unique_ptr<aura::Window> pinned_window(CreateTestWindow(bounds));
696 std::unique_ptr<aura::Window> always_on_top_window1(CreateTestWindow(bounds)); 696 std::unique_ptr<aura::Window> always_on_top_window1(CreateTestWindow(bounds));
697 std::unique_ptr<aura::Window> always_on_top_window2(CreateTestWindow(bounds)); 697 std::unique_ptr<aura::Window> always_on_top_window2(CreateTestWindow(bounds));
698 always_on_top_window1->SetProperty(aura::client::kAlwaysOnTopKey, true); 698 always_on_top_window1->SetProperty(aura::client::kAlwaysOnTopKey, true);
699 always_on_top_window2->SetProperty(aura::client::kAlwaysOnTopKey, true); 699 always_on_top_window2->SetProperty(aura::client::kAlwaysOnTopKey, true);
700 700
701 // Making a window pinned temporarily suspends always on top state. 701 // Making a window pinned temporarily suspends always on top state.
702 wm::PinWindow(pinned_window.get()); 702 wm::PinWindow(pinned_window.get(), /* trusted */ false);
703 EXPECT_FALSE( 703 EXPECT_FALSE(
704 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey)); 704 always_on_top_window1->GetProperty(aura::client::kAlwaysOnTopKey));
705 EXPECT_FALSE( 705 EXPECT_FALSE(
706 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey)); 706 always_on_top_window2->GetProperty(aura::client::kAlwaysOnTopKey));
707 707
708 // Adding a new always-on-top window also is affected by pinned mode. 708 // Adding a new always-on-top window also is affected by pinned mode.
709 std::unique_ptr<aura::Window> always_on_top_window3(CreateTestWindow(bounds)); 709 std::unique_ptr<aura::Window> always_on_top_window3(CreateTestWindow(bounds));
710 always_on_top_window3->SetProperty(aura::client::kAlwaysOnTopKey, true); 710 always_on_top_window3->SetProperty(aura::client::kAlwaysOnTopKey, true);
711 EXPECT_FALSE( 711 EXPECT_FALSE(
712 always_on_top_window3->GetProperty(aura::client::kAlwaysOnTopKey)); 712 always_on_top_window3->GetProperty(aura::client::kAlwaysOnTopKey));
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 changed_window_bounds.Offset(0, -shift); 1309 changed_window_bounds.Offset(0, -shift);
1310 // Window should be shifted up. 1310 // Window should be shifted up.
1311 EXPECT_EQ(changed_window_bounds, window->bounds()); 1311 EXPECT_EQ(changed_window_bounds, window->bounds());
1312 1312
1313 kb_controller->HideKeyboard( 1313 kb_controller->HideKeyboard(
1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); 1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC);
1315 EXPECT_EQ(orig_window_bounds, window->bounds()); 1315 EXPECT_EQ(orig_window_bounds, window->bounds());
1316 } 1316 }
1317 1317
1318 } // namespace ash 1318 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698