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

Side by Side Diff: ash/shelf/shelf_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: Added trusted argument. 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/shelf/shelf_layout_manager.h" 5 #include "ash/common/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/aura/wm_shelf_aura.h" 7 #include "ash/aura/wm_shelf_aura.h"
8 #include "ash/aura/wm_window_aura.h" 8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/accelerator_table.h" 10 #include "ash/common/accelerators/accelerator_table.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 // Test for Pinned mode. 1454 // Test for Pinned mode.
1455 TEST_F(ShelfLayoutManagerTest, PinnedWindowHidesShelf) { 1455 TEST_F(ShelfLayoutManagerTest, PinnedWindowHidesShelf) {
1456 WmShelf* shelf = GetPrimaryShelf(); 1456 WmShelf* shelf = GetPrimaryShelf();
1457 1457
1458 aura::Window* window1 = CreateTestWindow(); 1458 aura::Window* window1 = CreateTestWindow();
1459 window1->SetBounds(gfx::Rect(0, 0, 100, 100)); 1459 window1->SetBounds(gfx::Rect(0, 0, 100, 100));
1460 window1->Show(); 1460 window1->Show();
1461 1461
1462 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); 1462 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
1463 1463
1464 wm::PinWindow(window1); 1464 wm::PinWindow(window1, /* trusted */ false);
1465 EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); 1465 EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState());
1466 1466
1467 WmWindowAura::Get(window1)->GetWindowState()->Restore(); 1467 WmWindowAura::Get(window1)->GetWindowState()->Restore();
1468 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); 1468 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
1469 } 1469 }
1470 1470
1471 // Tests SHELF_ALIGNMENT_(LEFT, RIGHT). 1471 // Tests SHELF_ALIGNMENT_(LEFT, RIGHT).
1472 TEST_F(ShelfLayoutManagerTest, SetAlignment) { 1472 TEST_F(ShelfLayoutManagerTest, SetAlignment) {
1473 WmShelf* shelf = GetPrimaryShelf(); 1473 WmShelf* shelf = GetPrimaryShelf();
1474 ShelfLayoutManager* layout_manager = GetShelfLayoutManager(); 1474 ShelfLayoutManager* layout_manager = GetShelfLayoutManager();
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 // Open keyboard in sticky mode. 2076 // Open keyboard in sticky mode.
2077 kb_controller->ShowKeyboard(true); 2077 kb_controller->ShowKeyboard(true);
2078 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); 2078 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds());
2079 2079
2080 // Work area should be changed. 2080 // Work area should be changed.
2081 EXPECT_NE(orig_work_area, 2081 EXPECT_NE(orig_work_area,
2082 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); 2082 display::Screen::GetScreen()->GetPrimaryDisplay().work_area());
2083 } 2083 }
2084 2084
2085 } // namespace ash 2085 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698