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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 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
« ash/shell.cc ('K') | « ash/shell.cc ('k') | no next file » | 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/common/scoped_root_window_for_new_windows.h" 5 #include "ash/common/scoped_root_window_for_new_windows.h"
6 #include "ash/common/wm/window_positioner.h" 6 #include "ash/common/wm/window_positioner.h"
7 #include "ash/common/wm/window_resizer.h" 7 #include "ash/common/wm/window_resizer.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 // the non browser window. This differ from PersistedBoundsCase 817 // the non browser window. This differ from PersistedBoundsCase
818 // in that this uses real ash shell implementations + StateProvider 818 // in that this uses real ash shell implementations + StateProvider
819 // TargetDisplayProvider, rather than mocks. 819 // TargetDisplayProvider, rather than mocks.
820 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) { 820 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) {
821 if (!ash_util::ShouldOpenAshOnStartup()) 821 if (!ash_util::ShouldOpenAshOnStartup())
822 return; 822 return;
823 UpdateDisplay("500x500,600x600"); 823 UpdateDisplay("500x500,600x600");
824 824
825 // By default windows are placed on the primary display. 825 // By default windows are placed on the primary display.
826 ash::WmWindow* first_root = ash::WmShell::Get()->GetAllRootWindows()[0]; 826 ash::WmWindow* first_root = ash::WmShell::Get()->GetAllRootWindows()[0];
827 EXPECT_EQ(first_root, ash::WmShell::Get()->GetRootWindowForNewWindows()); 827 EXPECT_EQ(first_root,
828 ash::Shell::GetInstance()->GetRootWindowForNewWindows());
828 gfx::Rect bounds; 829 gfx::Rect bounds;
829 ui::WindowShowState show_state; 830 ui::WindowShowState show_state;
830 WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(), gfx::Rect(), 831 WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(), gfx::Rect(),
831 NULL, &bounds, &show_state); 832 NULL, &bounds, &show_state);
832 EXPECT_TRUE(first_root->GetBoundsInScreen().Contains(bounds)); 833 EXPECT_TRUE(first_root->GetBoundsInScreen().Contains(bounds));
833 834
834 { 835 {
835 // When the second display is active new windows are placed there. 836 // When the second display is active new windows are placed there.
836 ash::WmWindow* second_root = ash::WmShell::Get()->GetAllRootWindows()[1]; 837 ash::WmWindow* second_root = ash::WmShell::Get()->GetAllRootWindows()[1];
837 ash::ScopedRootWindowForNewWindows tmp(second_root); 838 ash::ScopedRootWindowForNewWindows tmp(second_root);
(...skipping 23 matching lines...) Expand all
861 EXPECT_EQ( 862 EXPECT_EQ(
862 ui::SHOW_STATE_DEFAULT, 863 ui::SHOW_STATE_DEFAULT,
863 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, 864 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH,
864 trusted_popup.get(), p1280x1024, p1600x1200)); 865 trusted_popup.get(), p1280x1024, p1600x1200));
865 // A popup that is sized to occupy the whole work area has default state. 866 // A popup that is sized to occupy the whole work area has default state.
866 EXPECT_EQ( 867 EXPECT_EQ(
867 ui::SHOW_STATE_DEFAULT, 868 ui::SHOW_STATE_DEFAULT,
868 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, 869 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH,
869 trusted_popup.get(), p1600x1200, p1600x1200)); 870 trusted_popup.get(), p1600x1200, p1600x1200));
870 } 871 }
OLDNEW
« ash/shell.cc ('K') | « ash/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698