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

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

Issue 2808723004: Renames WmShell to ShellPort (Closed)
Patch Set: feedback Created 3 years, 8 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
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/mus/top_level_window_factory.h" 5 #include "ash/mus/top_level_window_factory.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/mus/test/wm_test_base.h" 13 #include "ash/mus/test/wm_test_base.h"
14 #include "ash/mus/window_manager.h" 14 #include "ash/mus/window_manager.h"
15 #include "ash/mus/window_manager_application.h" 15 #include "ash/mus/window_manager_application.h"
16 #include "ash/shell_port.h"
16 #include "ash/test/ash_test.h" 17 #include "ash/test/ash_test.h"
17 #include "ash/test/ash_test_base.h" 18 #include "ash/test/ash_test_base.h"
18 #include "ash/test/ash_test_helper.h" 19 #include "ash/test/ash_test_helper.h"
19 #include "ash/wm_shell.h"
20 #include "ash/wm_window.h" 20 #include "ash/wm_window.h"
21 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
22 #include "ui/display/screen.h" 22 #include "ui/display/screen.h"
23 23
24 namespace ash { 24 namespace ash {
25 25
26 namespace { 26 namespace {
27 27
28 int64_t GetDisplayId(aura::Window* window) { 28 int64_t GetDisplayId(aura::Window* window) {
29 return display::Screen::GetScreen()->GetDisplayNearestWindow(window).id(); 29 return display::Screen::GetScreen()->GetDisplayNearestWindow(window).id();
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 using TopLevelWindowFactoryTest = AshTest; 34 using TopLevelWindowFactoryTest = AshTest;
35 35
36 TEST_F(TopLevelWindowFactoryTest, CreateFullscreenWindow) { 36 TEST_F(TopLevelWindowFactoryTest, CreateFullscreenWindow) {
37 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow(); 37 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow();
38 WmWindow* window = window_owner->window(); 38 WmWindow* window = window_owner->window();
39 window->SetFullscreen(true); 39 window->SetFullscreen(true);
40 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); 40 WmWindow* root_window = ShellPort::Get()->GetPrimaryRootWindow();
41 EXPECT_EQ(root_window->GetBounds(), window->GetBounds()); 41 EXPECT_EQ(root_window->GetBounds(), window->GetBounds());
42 } 42 }
43 43
44 using TopLevelWindowFactoryWmTest = mus::WmTestBase; 44 using TopLevelWindowFactoryWmTest = mus::WmTestBase;
45 45
46 TEST_F(TopLevelWindowFactoryWmTest, IsWindowShownInCorrectDisplay) { 46 TEST_F(TopLevelWindowFactoryWmTest, IsWindowShownInCorrectDisplay) {
47 UpdateDisplay("400x400,400x400"); 47 UpdateDisplay("400x400,400x400");
48 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id()); 48 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id());
49 49
50 std::unique_ptr<aura::Window> window_primary_display( 50 std::unique_ptr<aura::Window> window_primary_display(
(...skipping 12 matching lines...) Expand all
63 TEST_F(TopLevelWindowFactoryAshTest, TopLevelNotShownOnCreate) { 63 TEST_F(TopLevelWindowFactoryAshTest, TopLevelNotShownOnCreate) {
64 std::map<std::string, std::vector<uint8_t>> properties; 64 std::map<std::string, std::vector<uint8_t>> properties;
65 std::unique_ptr<aura::Window> window(mus::CreateAndParentTopLevelWindow( 65 std::unique_ptr<aura::Window> window(mus::CreateAndParentTopLevelWindow(
66 ash_test_helper()->window_manager_app()->window_manager(), 66 ash_test_helper()->window_manager_app()->window_manager(),
67 ui::mojom::WindowType::WINDOW, &properties)); 67 ui::mojom::WindowType::WINDOW, &properties));
68 ASSERT_TRUE(window); 68 ASSERT_TRUE(window);
69 EXPECT_FALSE(window->IsVisible()); 69 EXPECT_FALSE(window->IsVisible());
70 } 70 }
71 71
72 } // namespace ash 72 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698