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

Side by Side Diff: ash/mus/top_level_window_factory_unittest.cc

Issue 2622053004: ash: Restore previous show state after exiting fullscreen. (Closed)
Patch Set: Rebase Created 3 years, 11 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
« no previous file with comments | « ash/common/wm_window.cc ('k') | ash/wm/dock/docked_window_layout_manager_unittest.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 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"
11 11
12 namespace ash { 12 namespace ash {
13 13
14 namespace { 14 namespace {
15 15
16 int64_t GetDisplayId(aura::Window* window) { 16 int64_t GetDisplayId(aura::Window* window) {
17 return display::Screen::GetScreen()->GetDisplayNearestWindow(window).id(); 17 return display::Screen::GetScreen()->GetDisplayNearestWindow(window).id();
18 } 18 }
19 19
20 } // namespace 20 } // namespace
21 21
22 using TopLevelWindowFactoryTest = AshTest; 22 using TopLevelWindowFactoryTest = AshTest;
23 23
24 TEST_F(TopLevelWindowFactoryTest, CreateFullscreenWindow) { 24 TEST_F(TopLevelWindowFactoryTest, CreateFullscreenWindow) {
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(); 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()) 35 if (!SupportsMultipleDisplays())
36 return; 36 return;
37 37
38 UpdateDisplay("400x400,400x400"); 38 UpdateDisplay("400x400,400x400");
39 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id()); 39 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id());
40 40
41 std::unique_ptr<aura::Window> window_primary_display( 41 std::unique_ptr<aura::Window> window_primary_display(
42 CreateFullscreenTestWindow(GetPrimaryDisplay().id())); 42 CreateFullscreenTestWindow(GetPrimaryDisplay().id()));
43 std::unique_ptr<aura::Window> window_secondary_display( 43 std::unique_ptr<aura::Window> window_secondary_display(
44 CreateFullscreenTestWindow(GetSecondaryDisplay().id())); 44 CreateFullscreenTestWindow(GetSecondaryDisplay().id()));
45 45
46 EXPECT_EQ(GetPrimaryDisplay().id(), 46 EXPECT_EQ(GetPrimaryDisplay().id(),
47 GetDisplayId(window_primary_display.get())); 47 GetDisplayId(window_primary_display.get()));
48 EXPECT_EQ(GetSecondaryDisplay().id(), 48 EXPECT_EQ(GetSecondaryDisplay().id(),
49 GetDisplayId(window_secondary_display.get())); 49 GetDisplayId(window_secondary_display.get()));
50 } 50 }
51 51
52 } // namespace ash 52 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_window.cc ('k') | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698