| 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 "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class ScreenPositionControllerTest : public test::AshTestBase { | 43 class ScreenPositionControllerTest : public test::AshTestBase { |
| 44 public: | 44 public: |
| 45 ScreenPositionControllerTest() : window_(NULL) {} | 45 ScreenPositionControllerTest() : window_(NULL) {} |
| 46 virtual ~ScreenPositionControllerTest() {} | 46 virtual ~ScreenPositionControllerTest() {} |
| 47 | 47 |
| 48 virtual void SetUp() OVERRIDE { | 48 virtual void SetUp() OVERRIDE { |
| 49 AshTestBase::SetUp(); | 49 AshTestBase::SetUp(); |
| 50 window_.reset(new aura::Window(&window_delegate_)); | 50 window_.reset(new aura::Window(&window_delegate_)); |
| 51 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 51 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
| 52 window_->Init(ui::LAYER_NOT_DRAWN); | 52 window_->Init(ui::LAYER_NOT_DRAWN); |
| 53 window_->SetParent(NULL); | 53 SetDefaultParentByPrimaryRootWindow(window_.get()); |
| 54 window_->set_id(1); | 54 window_->set_id(1); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void TearDown() OVERRIDE { | 57 virtual void TearDown() OVERRIDE { |
| 58 window_.reset(); | 58 window_.reset(); |
| 59 AshTestBase::TearDown(); | 59 AshTestBase::TearDown(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Converts a native point (x, y) to screen and returns its string | 62 // Converts a native point (x, y) to screen and returns its string |
| 63 // representation. | 63 // representation. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 EXPECT_EQ("120,35", ConvertNativePointToScreen(200, 30)); | 186 EXPECT_EQ("120,35", ConvertNativePointToScreen(200, 30)); |
| 187 // At the edge but still in the primary display. Remaining of the primary | 187 // At the edge but still in the primary display. Remaining of the primary |
| 188 // display is (50, 50) but adding ~100 since it's 2x-display. | 188 // display is (50, 50) but adding ~100 since it's 2x-display. |
| 189 EXPECT_EQ("99,99", ConvertNativePointToScreen(159, 159)); | 189 EXPECT_EQ("99,99", ConvertNativePointToScreen(159, 159)); |
| 190 // At the edge of the secondary display. | 190 // At the edge of the secondary display. |
| 191 EXPECT_EQ("100,100", ConvertNativePointToScreen(160, 160)); | 191 EXPECT_EQ("100,100", ConvertNativePointToScreen(160, 160)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace test | 194 } // namespace test |
| 195 } // namespace ash | 195 } // namespace ash |
| OLD | NEW |