OLD | NEW |
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/wm/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
6 | 6 |
7 #include "ash/focus_cycler.h" | 7 #include "ash/focus_cycler.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // it when the user is using the keyboard (i.e. through FocusCycler). | 394 // it when the user is using the keyboard (i.e. through FocusCycler). |
395 shelf->status()->Activate(); | 395 shelf->status()->Activate(); |
396 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 396 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
397 | 397 |
398 shelf->launcher()->GetFocusCycler()->RotateFocus(FocusCycler::FORWARD); | 398 shelf->launcher()->GetFocusCycler()->RotateFocus(FocusCycler::FORWARD); |
399 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_SHOWN, shelf->auto_hide_state()); | 399 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
400 } | 400 } |
401 | 401 |
402 // Makes sure shelf will be visible when app list opens as shelf is in VISIBLE | 402 // Makes sure shelf will be visible when app list opens as shelf is in VISIBLE |
403 // state,and toggling app list won't change shelf visibility state. | 403 // state,and toggling app list won't change shelf visibility state. |
404 // Disabled due to a real bug, see http://crbug.com/127538. | 404 TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfVisibleState) { |
405 TEST_F(ShelfLayoutManagerTest, DISABLED_OpenAppListWithShelfVisibleState) { | |
406 Shell* shell = Shell::GetInstance(); | 405 Shell* shell = Shell::GetInstance(); |
407 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); | 406 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
408 shelf->LayoutShelf(); | 407 shelf->LayoutShelf(); |
409 shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT); | 408 shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT); |
410 | 409 |
411 // Create a normal unmaximized windowm shelf should be visible. | 410 // Create a normal unmaximized windowm shelf should be visible. |
412 aura::Window* window = CreateTestWindow(); | 411 aura::Window* window = CreateTestWindow(); |
413 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 412 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
414 window->Show(); | 413 window->Show(); |
415 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 414 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
416 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 415 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
417 | 416 |
418 // Toggle app list to show, and the shelf stays visible. | 417 // Toggle app list to show, and the shelf stays visible. |
419 shell->ToggleAppList(); | 418 shell->ToggleAppList(); |
420 EXPECT_TRUE(shell->GetAppListTargetVisibility()); | 419 EXPECT_TRUE(shell->GetAppListTargetVisibility()); |
421 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 420 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
422 | 421 |
423 // Toggle app list to hide, and the shelf stays visible. | 422 // Toggle app list to hide, and the shelf stays visible. |
424 shell->ToggleAppList(); | 423 shell->ToggleAppList(); |
425 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 424 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
426 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 425 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
427 } | 426 } |
428 | 427 |
429 // Makes sure shelf will be shown with AUTO_HIDE_SHOWN state when app list opens | 428 // Makes sure shelf will be shown with AUTO_HIDE_SHOWN state when app list opens |
430 // as shelf is in AUTO_HIDE state, and toggling app list won't change shelf | 429 // as shelf is in AUTO_HIDE state, and toggling app list won't change shelf |
431 // visibility state. | 430 // visibility state. |
432 // Disabled due to a real bug, see http://crbug.com/127538. | 431 TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) { |
433 TEST_F(ShelfLayoutManagerTest, DISABLED_OpenAppListWithShelfAutoHideState) { | |
434 Shell* shell = Shell::GetInstance(); | 432 Shell* shell = Shell::GetInstance(); |
435 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); | 433 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
436 shelf->LayoutShelf(); | 434 shelf->LayoutShelf(); |
437 shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT); | 435 shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT); |
438 | 436 |
439 // Create a window and show it in maximized state. | 437 // Create a window and show it in maximized state. |
440 aura::Window* window = CreateTestWindow(); | 438 aura::Window* window = CreateTestWindow(); |
441 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 439 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
442 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 440 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
443 window->Show(); | 441 window->Show(); |
(...skipping 12 matching lines...) Expand all Loading... |
456 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_SHOWN, shelf->auto_hide_state()); | 454 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
457 | 455 |
458 // Toggle app list to hide. | 456 // Toggle app list to hide. |
459 shell->ToggleAppList(); | 457 shell->ToggleAppList(); |
460 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 458 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
461 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 459 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
462 } | 460 } |
463 | 461 |
464 // Makes sure shelf will be hidden when app list opens as shelf is in HIDDEN | 462 // Makes sure shelf will be hidden when app list opens as shelf is in HIDDEN |
465 // state, and toggling app list won't change shelf visibility state. | 463 // state, and toggling app list won't change shelf visibility state. |
466 // Disabled due to a real bug, see http://crbug.com/127538. | 464 TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) { |
467 TEST_F(ShelfLayoutManagerTest, DISABLED_OpenAppListWithShelfHiddenState) { | |
468 Shell* shell = Shell::GetInstance(); | 465 Shell* shell = Shell::GetInstance(); |
469 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); | 466 ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
470 // For shelf to be visible, app list is not open in initial state. | 467 // For shelf to be visible, app list is not open in initial state. |
471 shelf->LayoutShelf(); | 468 shelf->LayoutShelf(); |
472 | 469 |
473 // Create a window and make it full screen. | 470 // Create a window and make it full screen. |
474 aura::Window* window = CreateTestWindow(); | 471 aura::Window* window = CreateTestWindow(); |
475 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 472 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
476 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 473 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
477 window->Show(); | 474 window->Show(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 EXPECT_EQ(0, monitor.GetWorkAreaInsets().top()); | 541 EXPECT_EQ(0, monitor.GetWorkAreaInsets().top()); |
545 EXPECT_EQ(0, monitor.GetWorkAreaInsets().bottom()); | 542 EXPECT_EQ(0, monitor.GetWorkAreaInsets().bottom()); |
546 EXPECT_EQ(0, monitor.GetWorkAreaInsets().left()); | 543 EXPECT_EQ(0, monitor.GetWorkAreaInsets().left()); |
547 EXPECT_EQ(monitor.work_area().right(), launcher_bounds.x()); | 544 EXPECT_EQ(monitor.work_area().right(), launcher_bounds.x()); |
548 EXPECT_EQ(monitor.bounds().y(), launcher_bounds.y()); | 545 EXPECT_EQ(monitor.bounds().y(), launcher_bounds.y()); |
549 EXPECT_EQ(monitor.bounds().height(), launcher_bounds.height()); | 546 EXPECT_EQ(monitor.bounds().height(), launcher_bounds.height()); |
550 } | 547 } |
551 | 548 |
552 } // namespace internal | 549 } // namespace internal |
553 } // namespace ash | 550 } // namespace ash |
OLD | NEW |