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

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

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Reduce code size to convert rect from window to screen coordinate. Created 4 years 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/root_window_controller.h" 5 #include "ash/mus/root_window_controller.h"
6 6
7 #include "ash/common/test/ash_test.h" 7 #include "ash/common/test/ash_test.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/common/wm_window.h" 9 #include "ash/common/wm_window.h"
10 #include "ash/mus/test/wm_test_base.h"
10 11
11 namespace ash { 12 namespace ash {
12 13
13 using RootWindowControllerTest = AshTest; 14 using RootWindowControllerTest = AshTest;
14 15
15 TEST_F(RootWindowControllerTest, CreateFullscreenWindow) { 16 TEST_F(RootWindowControllerTest, CreateFullscreenWindow) {
16 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow(); 17 std::unique_ptr<WindowOwner> window_owner = CreateToplevelTestWindow();
17 WmWindow* window = window_owner->window(); 18 WmWindow* window = window_owner->window();
18 window->SetFullscreen(); 19 window->SetFullscreen();
19 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); 20 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow();
20 EXPECT_EQ(root_window->GetBounds(), window->GetBounds()); 21 EXPECT_EQ(root_window->GetBounds(), window->GetBounds());
21 } 22 }
22 23
24 using RootWindowControllerWmTest = mus::WmTestBase;
25
26 TEST_F(RootWindowControllerWmTest, IsWindowShownInCorrectDisplay) {
27 if (!SupportsMultipleDisplays())
28 return;
29
30 UpdateDisplay("400x400,400x400");
31 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id());
32
33 ui::Window* window_primary_display =
34 CreateFullscreenTestWindow(GetPrimaryDisplay().id());
35 ui::Window* window_secondary_display =
36 CreateFullscreenTestWindow(GetSecondaryDisplay().id());
37
38 DCHECK(window_primary_display);
sky 2016/11/29 17:43:13 For tests prefer ASSERT over DCHECK. The reason is
39 DCHECK(window_secondary_display);
40
41 EXPECT_EQ(window_primary_display->display_id(), GetPrimaryDisplay().id());
sky 2016/11/29 17:43:13 In chrome code we use the format of expected, actu
42 EXPECT_EQ(window_secondary_display->display_id(), GetSecondaryDisplay().id());
43 }
44
23 } // namespace ash 45 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698