| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/ash_test.h" | 5 #include "ash/common/test/ash_test.h" |
| 6 #include "ash/common/wm_shell.h" | 6 #include "ash/common/wm_shell.h" |
| 7 #include "ash/common/wm_window.h" | 7 #include "ash/common/wm_window.h" |
| 8 #include "ash/mus/test/wm_test_base.h" | 8 #include "ash/mus/test/wm_test_base.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/display/screen.h" | 10 #include "ui/display/screen.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow(); | 25 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow(); |
| 26 WmWindow* window = window_owner->window(); | 26 WmWindow* window = window_owner->window(); |
| 27 window->SetFullscreen(true); | 27 window->SetFullscreen(true); |
| 28 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); | 28 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); |
| 29 EXPECT_EQ(root_window->GetBounds(), window->GetBounds()); | 29 EXPECT_EQ(root_window->GetBounds(), window->GetBounds()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 using TopLevelWindowFactoryWmTest = mus::WmTestBase; | 32 using TopLevelWindowFactoryWmTest = mus::WmTestBase; |
| 33 | 33 |
| 34 TEST_F(TopLevelWindowFactoryWmTest, IsWindowShownInCorrectDisplay) { | 34 TEST_F(TopLevelWindowFactoryWmTest, IsWindowShownInCorrectDisplay) { |
| 35 if (!SupportsMultipleDisplays()) | |
| 36 return; | |
| 37 | |
| 38 UpdateDisplay("400x400,400x400"); | 35 UpdateDisplay("400x400,400x400"); |
| 39 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id()); | 36 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id()); |
| 40 | 37 |
| 41 std::unique_ptr<aura::Window> window_primary_display( | 38 std::unique_ptr<aura::Window> window_primary_display( |
| 42 CreateFullscreenTestWindow(GetPrimaryDisplay().id())); | 39 CreateFullscreenTestWindow(GetPrimaryDisplay().id())); |
| 43 std::unique_ptr<aura::Window> window_secondary_display( | 40 std::unique_ptr<aura::Window> window_secondary_display( |
| 44 CreateFullscreenTestWindow(GetSecondaryDisplay().id())); | 41 CreateFullscreenTestWindow(GetSecondaryDisplay().id())); |
| 45 | 42 |
| 46 EXPECT_EQ(GetPrimaryDisplay().id(), | 43 EXPECT_EQ(GetPrimaryDisplay().id(), |
| 47 GetDisplayId(window_primary_display.get())); | 44 GetDisplayId(window_primary_display.get())); |
| 48 EXPECT_EQ(GetSecondaryDisplay().id(), | 45 EXPECT_EQ(GetSecondaryDisplay().id(), |
| 49 GetDisplayId(window_secondary_display.get())); | 46 GetDisplayId(window_secondary_display.get())); |
| 50 } | 47 } |
| 51 | 48 |
| 52 } // namespace ash | 49 } // namespace ash |
| OLD | NEW |