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/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" |
11 #include "ash/screen_util.h" | 11 #include "ash/display/display_manager.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
14 #include "ash/wm/window_state_aura.h" | 14 #include "ash/wm/window_state_aura.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/ui/ash/ash_util.h" | 17 #include "chrome/browser/ui/ash/ash_util.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" | 19 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/test/base/test_browser_window_aura.h" | 21 #include "chrome/test/base/test_browser_window_aura.h" |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 #else | 554 #else |
555 // No multiple displays on windows ash. | 555 // No multiple displays on windows ash. |
556 #define MAYBE_PlaceNewWindowsOnMultipleDisplays DISABLED_PlaceNewWindowsOnMultip
leDisplays | 556 #define MAYBE_PlaceNewWindowsOnMultipleDisplays DISABLED_PlaceNewWindowsOnMultip
leDisplays |
557 #endif | 557 #endif |
558 | 558 |
559 // Test the placement of newly created windows on multiple dislays. | 559 // Test the placement of newly created windows on multiple dislays. |
560 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { | 560 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { |
561 UpdateDisplay("1600x1200,1600x1200"); | 561 UpdateDisplay("1600x1200,1600x1200"); |
562 gfx::Rect primary_bounds = | 562 gfx::Rect primary_bounds = |
563 display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); | 563 display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); |
564 gfx::Rect secondary_bounds = ash::ScreenUtil::GetSecondaryDisplay().bounds(); | 564 gfx::Rect secondary_bounds = |
| 565 display_manager()->GetSecondaryDisplay().bounds(); |
565 | 566 |
566 std::unique_ptr<TestingProfile> profile(new TestingProfile()); | 567 std::unique_ptr<TestingProfile> profile(new TestingProfile()); |
567 | 568 |
568 // Create browser windows that are used as reference. | 569 // Create browser windows that are used as reference. |
569 Browser::CreateParams params(profile.get()); | 570 Browser::CreateParams params(profile.get()); |
570 std::unique_ptr<Browser> browser(CreateTestBrowser( | 571 std::unique_ptr<Browser> browser(CreateTestBrowser( |
571 CreateTestWindowInShellWithId(0), gfx::Rect(10, 10, 200, 200), ¶ms)); | 572 CreateTestWindowInShellWithId(0), gfx::Rect(10, 10, 200, 200), ¶ms)); |
572 BrowserWindow* browser_window = browser->window(); | 573 BrowserWindow* browser_window = browser->window(); |
573 gfx::NativeWindow native_window = browser_window->GetNativeWindow(); | 574 gfx::NativeWindow native_window = browser_window->GetNativeWindow(); |
574 browser_window->Show(); | 575 browser_window->Show(); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 EXPECT_EQ( | 861 EXPECT_EQ( |
861 ui::SHOW_STATE_DEFAULT, | 862 ui::SHOW_STATE_DEFAULT, |
862 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 863 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
863 trusted_popup.get(), p1280x1024, p1600x1200)); | 864 trusted_popup.get(), p1280x1024, p1600x1200)); |
864 // A popup that is sized to occupy the whole work area has default state. | 865 // A popup that is sized to occupy the whole work area has default state. |
865 EXPECT_EQ( | 866 EXPECT_EQ( |
866 ui::SHOW_STATE_DEFAULT, | 867 ui::SHOW_STATE_DEFAULT, |
867 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 868 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
868 trusted_popup.get(), p1600x1200, p1600x1200)); | 869 trusted_popup.get(), p1600x1200, p1600x1200)); |
869 } | 870 } |
OLD | NEW |