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

Side by Side Diff: ash/display/screen_ash_unittest.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: . Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/test/ash_test_base.h" 7 #include "ash/test/ash_test_base.h"
8 #include "ui/aura/test/test_window_delegate.h" 8 #include "ui/aura/test/test_window_delegate.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 10
11 namespace ash { 11 namespace ash {
12 12
13 class ScreenAshTest : public test::AshTestBase { 13 class ScreenAshTest : public test::AshTestBase {
14 public: 14 public:
15 ScreenAshTest() {} 15 ScreenAshTest() {}
16 ~ScreenAshTest() override {} 16 ~ScreenAshTest() override {}
17 17
18 static gfx::Screen* Screen() { return Shell::GetScreen(); } 18 static gfx::Screen* Screen() { return gfx::Screen::GetScreen(); }
sky 2016/01/20 04:44:26 Nuke this too.
scottmg 2016/01/26 20:46:35 Done.
19 19
20 private: 20 private:
21 DISALLOW_COPY_AND_ASSIGN(ScreenAshTest); 21 DISALLOW_COPY_AND_ASSIGN(ScreenAshTest);
22 }; 22 };
23 23
24 // Tests that ScreenAsh::GetWindowAtScreenPoint() returns the correct window on 24 // Tests that ScreenAsh::GetWindowAtScreenPoint() returns the correct window on
25 // the correct display. 25 // the correct display.
26 TEST_F(ScreenAshTest, TestGetWindowAtScreenPoint) { 26 TEST_F(ScreenAshTest, TestGetWindowAtScreenPoint) {
27 if (!SupportsMultipleDisplays()) 27 if (!SupportsMultipleDisplays())
28 return; 28 return;
29 29
30 UpdateDisplay("200x200,400x400"); 30 UpdateDisplay("200x200,400x400");
31 31
32 aura::test::TestWindowDelegate delegate; 32 aura::test::TestWindowDelegate delegate;
33 scoped_ptr<aura::Window> win1(CreateTestWindowInShellWithDelegate( 33 scoped_ptr<aura::Window> win1(CreateTestWindowInShellWithDelegate(
34 &delegate, 0, gfx::Rect(0, 0, 200, 200))); 34 &delegate, 0, gfx::Rect(0, 0, 200, 200)));
35 35
36 scoped_ptr<aura::Window> win2(CreateTestWindowInShellWithDelegate( 36 scoped_ptr<aura::Window> win2(CreateTestWindowInShellWithDelegate(
37 &delegate, 1, gfx::Rect(200, 200, 100, 100))); 37 &delegate, 1, gfx::Rect(200, 200, 100, 100)));
38 38
39 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow()); 39 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow());
40 40
41 EXPECT_EQ(win1.get(), Screen()->GetWindowAtScreenPoint(gfx::Point(50, 60))); 41 EXPECT_EQ(win1.get(), Screen()->GetWindowAtScreenPoint(gfx::Point(50, 60)));
42 EXPECT_EQ(win2.get(), Screen()->GetWindowAtScreenPoint(gfx::Point(250, 260))); 42 EXPECT_EQ(win2.get(), Screen()->GetWindowAtScreenPoint(gfx::Point(250, 260)));
43 } 43 }
44 44
45 } // namespace ash 45 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698