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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 149303003: [Refactor] Move the logic to update bounds for show type from WorkspaceLayoutManager to DefaultState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
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/workspace/workspace_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include "ash/display/display_layout.h" 7 #include "ash/display/display_layout.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 TEST_F(WorkspaceLayoutManagerSoloTest, FocusDuringUnminimize) { 580 TEST_F(WorkspaceLayoutManagerSoloTest, FocusDuringUnminimize) {
581 FocusDelegate delegate; 581 FocusDelegate delegate;
582 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate( 582 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate(
583 &delegate, 0, gfx::Rect(100, 100, 100, 100))); 583 &delegate, 0, gfx::Rect(100, 100, 100, 100)));
584 delegate.set_window(window.get()); 584 delegate.set_window(window.get());
585 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 585 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
586 EXPECT_FALSE(window->IsVisible()); 586 EXPECT_FALSE(window->IsVisible());
587 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, delegate.GetShowStateAndReset()); 587 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, delegate.GetShowStateAndReset());
588 window->Show(); 588 window->Show();
589 EXPECT_TRUE(window->IsVisible()); 589 EXPECT_TRUE(window->IsVisible());
590 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, delegate.GetShowStateAndReset()); 590 EXPECT_EQ(ui::SHOW_STATE_NORMAL, delegate.GetShowStateAndReset());
591 } 591 }
592 592
593 // Tests maximized window size during root window resize. 593 // Tests maximized window size during root window resize.
594 TEST_F(WorkspaceLayoutManagerSoloTest, MaximizeRootWindowResize) { 594 TEST_F(WorkspaceLayoutManagerSoloTest, MaximizeRootWindowResize) {
595 gfx::Rect bounds(100, 100, 200, 200); 595 gfx::Rect bounds(100, 100, 200, 200);
596 scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); 596 scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
597 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 597 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
598 gfx::Rect initial_work_area_bounds = 598 gfx::Rect initial_work_area_bounds =
599 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()); 599 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get());
600 EXPECT_EQ(initial_work_area_bounds.ToString(), window->bounds().ToString()); 600 EXPECT_EQ(initial_work_area_bounds.ToString(), window->bounds().ToString());
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 EXPECT_NE( 767 EXPECT_NE(
768 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), 768 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(),
769 window_bounds.ToString()); 769 window_bounds.ToString());
770 770
771 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); 771 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
772 shelf->UpdateVisibilityState(); 772 shelf->UpdateVisibilityState();
773 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); 773 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString());
774 } 774 }
775 775
776 } // namespace ash 776 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698