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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. Created 7 years, 8 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
11 #include "ash/focus_cycler.h" 11 #include "ash/focus_cycler.h"
12 #include "ash/launcher/launcher.h" 12 #include "ash/launcher/launcher.h"
13 #include "ash/launcher/launcher_view.h" 13 #include "ash/launcher/launcher_view.h"
14 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
15 #include "ash/screen_ash.h" 15 #include "ash/screen_ash.h"
16 #include "ash/session_state_delegate.h"
16 #include "ash/shelf/shelf_widget.h" 17 #include "ash/shelf/shelf_widget.h"
17 #include "ash/shell.h" 18 #include "ash/shell.h"
18 #include "ash/shell_delegate.h"
19 #include "ash/shell_window_ids.h" 19 #include "ash/shell_window_ids.h"
20 #include "ash/system/status_area_widget.h" 20 #include "ash/system/status_area_widget.h"
21 #include "ash/system/tray/system_tray.h" 21 #include "ash/system/tray/system_tray.h"
22 #include "ash/system/tray/system_tray_item.h" 22 #include "ash/system/tray/system_tray_item.h"
23 #include "ash/test/ash_test_base.h" 23 #include "ash/test/ash_test_base.h"
24 #include "ash/wm/window_util.h" 24 #include "ash/wm/window_util.h"
25 #include "base/command_line.h" 25 #include "base/command_line.h"
26 #include "base/utf_string_conversions.h" 26 #include "base/utf_string_conversions.h"
27 #include "ui/aura/client/aura_constants.h" 27 #include "ui/aura/client/aura_constants.h"
28 #include "ui/aura/root_window.h" 28 #include "ui/aura/root_window.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 views::Widget::InitParams::TYPE_WINDOW); 490 views::Widget::InitParams::TYPE_WINDOW);
491 lock_params.bounds = gfx::Rect(0, 0, 200, 200); 491 lock_params.bounds = gfx::Rect(0, 0, 200, 200);
492 params.context = CurrentContext(); 492 params.context = CurrentContext();
493 lock_params.parent = lock_container; 493 lock_params.parent = lock_container;
494 // Widget is now owned by the parent window. 494 // Widget is now owned by the parent window.
495 lock_widget->Init(lock_params); 495 lock_widget->Init(lock_params);
496 lock_widget->Maximize(); 496 lock_widget->Maximize();
497 lock_widget->Show(); 497 lock_widget->Show();
498 498
499 // Lock the screen. 499 // Lock the screen.
500 Shell::GetInstance()->delegate()->LockScreen(); 500 Shell::GetInstance()->session_state_delegate()->LockScreen();
501 shelf->UpdateVisibilityState(); 501 shelf->UpdateVisibilityState();
502 // Showing a widget in the lock screen should force the shelf to be visibile. 502 // Showing a widget in the lock screen should force the shelf to be visibile.
503 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); 503 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
504 504
505 Shell::GetInstance()->delegate()->UnlockScreen(); 505 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
506 shelf->UpdateVisibilityState(); 506 shelf->UpdateVisibilityState();
507 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); 507 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
508 } 508 }
509 509
510 // Assertions around SetAutoHideBehavior. 510 // Assertions around SetAutoHideBehavior.
511 TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) { 511 TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) {
512 // Since ShelfLayoutManager queries for mouse location, move the mouse so 512 // Since ShelfLayoutManager queries for mouse location, move the mouse so
513 // it isn't over the shelf. 513 // it isn't over the shelf.
514 aura::test::EventGenerator generator( 514 aura::test::EventGenerator generator(
515 Shell::GetPrimaryRootWindow(), gfx::Point()); 515 Shell::GetPrimaryRootWindow(), gfx::Point());
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); 1323 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
1324 } else { 1324 } else {
1325 EXPECT_FALSE(shelf->IsVisible()); 1325 EXPECT_FALSE(shelf->IsVisible());
1326 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 1326 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
1327 } 1327 }
1328 } 1328 }
1329 } 1329 }
1330 1330
1331 } // namespace internal 1331 } // namespace internal
1332 } // namespace ash 1332 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698