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/screen_ash.h" | 5 #include "ash/screen_ash.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/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 #include "ui/views/widget/widget_delegate.h" | 15 #include "ui/views/widget/widget_delegate.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 namespace test { | 18 namespace test { |
| 19 class ScreenAshTest : public test::AshTestBase { |
| 20 public: |
| 21 ScreenAshTest() {} |
| 22 virtual ~ScreenAshTest() {} |
19 | 23 |
20 typedef test::AshTestBase ScreenAshTest; | 24 virtual void SetUp() OVERRIDE { |
| 25 internal::DisplayController::SetExtendedDesktopEnabled(true); |
| 26 AshTestBase::SetUp(); |
| 27 } |
| 28 |
| 29 virtual void TearDown() OVERRIDE { |
| 30 AshTestBase::TearDown(); |
| 31 internal::DisplayController::SetExtendedDesktopEnabled(false); |
| 32 } |
| 33 |
| 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(ScreenAshTest); |
| 36 }; |
21 | 37 |
22 #if !defined(OS_WIN) | 38 #if !defined(OS_WIN) |
23 TEST_F(ScreenAshTest, Bounds) { | 39 TEST_F(ScreenAshTest, Bounds) { |
24 UpdateDisplay("600x600,500x500"); | 40 UpdateDisplay("600x600,500x500"); |
25 | 41 |
26 views::Widget* primary = | 42 views::Widget* primary = |
27 views::Widget::CreateWindowWithBounds(NULL, gfx::Rect(10, 10, 100, 100)); | 43 views::Widget::CreateWindowWithBounds(NULL, gfx::Rect(10, 10, 100, 100)); |
28 primary->Show(); | 44 primary->Show(); |
29 views::Widget* secondary = | 45 views::Widget* secondary = |
30 views::Widget::CreateWindowWithBounds(NULL, gfx::Rect(610, 10, 100, 100)); | 46 views::Widget::CreateWindowWithBounds(NULL, gfx::Rect(610, 10, 100, 100)); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ScreenAsh::ConvertRectToScreen( | 104 ScreenAsh::ConvertRectToScreen( |
89 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); | 105 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); |
90 EXPECT_EQ( | 106 EXPECT_EQ( |
91 "650,50 100x100", | 107 "650,50 100x100", |
92 ScreenAsh::ConvertRectToScreen( | 108 ScreenAsh::ConvertRectToScreen( |
93 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); | 109 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); |
94 } | 110 } |
95 | 111 |
96 } // namespace test | 112 } // namespace test |
97 } // namespace ash | 113 } // namespace ash |
OLD | NEW |