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

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

Issue 2906873003: chromeos: turn on simplified display management for mash (Closed)
Patch Set: bug refs Created 3 years, 6 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/mus/bridge/shell_port_mash.cc ('k') | ash/mus/window_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/mus/screen_mus.h"
6
7 #include "ash/mus/window_manager.h"
8 #include "ash/mus/window_manager_application.h"
9 #include "ash/test/ash_test_base.h"
10 #include "ash/test/ash_test_helper.h"
11 #include "ui/aura/test/test_window_delegate.h"
12
13 namespace ash {
14 namespace test {
15
16 class ScreenMusTest : public AshTestBase {
17 public:
18 ScreenMusTest() {}
19 ~ScreenMusTest() override {}
20
21 display::Screen* screen_mus() {
22 return ash_test_helper()->window_manager_app()->window_manager()->screen();
23 }
24
25 private:
26 DISALLOW_COPY_AND_ASSIGN(ScreenMusTest);
27 };
28
29 TEST_F(ScreenMusTest, GetWindowAtScreenPoint) {
30 UpdateDisplay("1024x600");
31
32 aura::test::TestWindowDelegate test_delegate;
33 std::unique_ptr<aura::Window> w1(CreateTestWindowInShellWithDelegate(
34 &test_delegate, 23, gfx::Rect(20, 20, 50, 50)));
35
36 aura::Window* at_point =
37 screen_mus()->GetWindowAtScreenPoint(gfx::Point(25, 25));
38 EXPECT_EQ(w1.get(), at_point);
39
40 // Create a second window which overlaps with w1.
41 std::unique_ptr<aura::Window> w2(CreateTestWindowInShellWithDelegate(
42 &test_delegate, 17, gfx::Rect(25, 25, 50, 50)));
43 at_point = screen_mus()->GetWindowAtScreenPoint(gfx::Point(25, 25));
44 EXPECT_EQ(w2.get(), at_point);
45
46 // Raise w1.
47 w1->parent()->StackChildAtTop(w1.get());
48 at_point = screen_mus()->GetWindowAtScreenPoint(gfx::Point(25, 25));
49 EXPECT_EQ(w1.get(), at_point);
50 }
51
52 } // namespace test
53 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/shell_port_mash.cc ('k') | ash/mus/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698