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

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

Issue 2653593004: chromeos: Remove AshTestBase::SupportsMultipleDisplays (Closed)
Patch Set: 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
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/shell.h" 5 #include "ash/shell.h"
6 #include "ash/test/ash_test_base.h" 6 #include "ash/test/ash_test_base.h"
7 #include "ui/aura/test/test_window_delegate.h" 7 #include "ui/aura/test/test_window_delegate.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/display/manager/display_manager.h" 9 #include "ui/display/manager/display_manager.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 private: 18 private:
19 DISALLOW_COPY_AND_ASSIGN(ScreenAshTest); 19 DISALLOW_COPY_AND_ASSIGN(ScreenAshTest);
20 }; 20 };
21 21
22 // Tests that ScreenAsh::GetWindowAtScreenPoint() returns the correct window on 22 // Tests that ScreenAsh::GetWindowAtScreenPoint() returns the correct window on
23 // the correct display. 23 // the correct display.
24 TEST_F(ScreenAshTest, TestGetWindowAtScreenPoint) { 24 TEST_F(ScreenAshTest, TestGetWindowAtScreenPoint) {
25 if (!SupportsMultipleDisplays())
26 return;
27
28 UpdateDisplay("200x200,400x400"); 25 UpdateDisplay("200x200,400x400");
29 26
30 aura::test::TestWindowDelegate delegate; 27 aura::test::TestWindowDelegate delegate;
31 std::unique_ptr<aura::Window> win1(CreateTestWindowInShellWithDelegate( 28 std::unique_ptr<aura::Window> win1(CreateTestWindowInShellWithDelegate(
32 &delegate, 0, gfx::Rect(0, 0, 200, 200))); 29 &delegate, 0, gfx::Rect(0, 0, 200, 200)));
33 30
34 std::unique_ptr<aura::Window> win2(CreateTestWindowInShellWithDelegate( 31 std::unique_ptr<aura::Window> win2(CreateTestWindowInShellWithDelegate(
35 &delegate, 1, gfx::Rect(200, 200, 100, 100))); 32 &delegate, 1, gfx::Rect(200, 200, 100, 100)));
36 33
37 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow()); 34 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow());
38 35
39 EXPECT_EQ(win1.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( 36 EXPECT_EQ(win1.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint(
40 gfx::Point(50, 60))); 37 gfx::Point(50, 60)));
41 EXPECT_EQ(win2.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( 38 EXPECT_EQ(win2.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint(
42 gfx::Point(250, 260))); 39 gfx::Point(250, 260)));
43 } 40 }
44 41
45 } // namespace ash 42 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/root_window_transformers_unittest.cc ('k') | ash/display/unified_mouse_warp_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698