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

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

Issue 10979090: Simplify WorkAreaBounds access logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Requested changes Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/workspace/snap_sizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wm/shelf_layout_manager.h" 5 #include "ash/wm/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/focus_cycler.h" 10 #include "ash/focus_cycler.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 params.bounds = gfx::Rect(0, 0, 200, 200); 434 params.bounds = gfx::Rect(0, 0, 200, 200);
435 // Widget is now owned by the parent window. 435 // Widget is now owned by the parent window.
436 widget->Init(params); 436 widget->Init(params);
437 widget->Show(); 437 widget->Show();
438 aura::Window* window = widget->GetNativeWindow(); 438 aura::Window* window = widget->GetNativeWindow();
439 gfx::Rect display_bounds( 439 gfx::Rect display_bounds(
440 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); 440 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds());
441 441
442 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 442 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
443 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); 443 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state());
444 EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, 444 // EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
445 shelf->GetMaximizedWindowBounds(window).bottom()); 445 // shelf->GetUnmaximizedWorkAreaBounds(window).bottom());
446 446
447 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 447 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
448 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); 448 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
449 EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, 449 // EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
450 shelf->GetMaximizedWindowBounds(window).bottom()); 450 // shelf->GetUnmaximizedWorkAreaBounds(window).bottom());
oshima 2012/10/16 23:44:32 nit: remove them
451 451
452 widget->Maximize(); 452 widget->Maximize();
453 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); 453 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
454 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 454 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
455 window).work_area().bottom(), 455 window).work_area().bottom(),
456 widget->GetWorkAreaBoundsInScreen().bottom()); 456 widget->GetWorkAreaBoundsInScreen().bottom());
457 457
458 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 458 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
459 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); 459 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state());
460 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 460 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 EXPECT_TRUE(status_area->IsMessageBubbleShown()); 954 EXPECT_TRUE(status_area->IsMessageBubbleShown());
955 } else { 955 } else {
956 EXPECT_FALSE(shelf->IsVisible()); 956 EXPECT_FALSE(shelf->IsVisible());
957 EXPECT_FALSE(status_area->IsMessageBubbleShown()); 957 EXPECT_FALSE(status_area->IsMessageBubbleShown());
958 } 958 }
959 } 959 }
960 } 960 }
961 961
962 } // namespace internal 962 } // namespace internal
963 } // namespace ash 963 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/workspace/snap_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698