OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/screen_position_controller.h" | 5 #include "ash/display/screen_position_controller.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/test/shell_test_api.h" | 10 #include "ash/test/shell_test_api.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 display_controller->SetLayoutForCurrentDisplays(layout); | 40 display_controller->SetLayoutForCurrentDisplays(layout); |
41 } | 41 } |
42 | 42 |
43 internal::ScreenPositionController* GetScreenPositionController() { | 43 internal::ScreenPositionController* GetScreenPositionController() { |
44 ShellTestApi test_api(Shell::GetInstance()); | 44 ShellTestApi test_api(Shell::GetInstance()); |
45 return test_api.screen_position_controller(); | 45 return test_api.screen_position_controller(); |
46 } | 46 } |
47 | 47 |
48 class ScreenPositionControllerTest : public test::AshTestBase { | 48 class ScreenPositionControllerTest : public test::AshTestBase { |
49 public: | 49 public: |
50 ScreenPositionControllerTest() : window_(NULL) {} | 50 ScreenPositionControllerTest() {} |
51 virtual ~ScreenPositionControllerTest() {} | 51 virtual ~ScreenPositionControllerTest() {} |
52 | 52 |
53 virtual void SetUp() OVERRIDE { | 53 virtual void SetUp() OVERRIDE { |
54 AshTestBase::SetUp(); | 54 AshTestBase::SetUp(); |
55 window_.reset(new aura::Window(&window_delegate_)); | 55 window_.reset(new aura::Window(&window_delegate_)); |
56 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 56 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
57 window_->Init(ui::LAYER_NOT_DRAWN); | 57 window_->Init(ui::LAYER_NOT_DRAWN); |
58 SetDefaultParentByPrimaryRootWindow(window_.get()); | 58 SetDefaultParentByPrimaryRootWindow(window_.get()); |
59 window_->set_id(1); | 59 window_->set_id(1); |
60 } | 60 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_EQ("210,70", ConvertHostPointToScreen(60, 70)); | 264 EXPECT_EQ("210,70", ConvertHostPointToScreen(60, 70)); |
265 // The point is out of the host windows. | 265 // The point is out of the host windows. |
266 EXPECT_EQ("210,-50", ConvertHostPointToScreen(60, -50)); | 266 EXPECT_EQ("210,-50", ConvertHostPointToScreen(60, -50)); |
267 // The point is on the 2nd host. Point on 1nd host (60, 60) | 267 // The point is on the 2nd host. Point on 1nd host (60, 60) |
268 // 1/2 * 1.5 = (45,45) | 268 // 1/2 * 1.5 = (45,45) |
269 EXPECT_EQ("45,45", ConvertHostPointToScreen(60, -340)); | 269 EXPECT_EQ("45,45", ConvertHostPointToScreen(60, -340)); |
270 } | 270 } |
271 | 271 |
272 } // namespace test | 272 } // namespace test |
273 } // namespace ash | 273 } // namespace ash |
OLD | NEW |