OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/content/keyboard_overlay/keyboard_overlay_delegate.h" | 5 #include "ash/content/keyboard_overlay/keyboard_overlay_delegate.h" |
6 | 6 |
7 #include "ash/shelf/shelf_types.h" | 7 #include "ash/shelf/shelf_types.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 "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/gfx/display.h" | 12 #include "ui/gfx/display.h" |
13 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 | 17 |
18 class KeyboardOverlayDelegateTest | 18 class KeyboardOverlayDelegateTest |
19 : public test::AshTestBase, | 19 : public test::AshTestBase, |
20 public testing::WithParamInterface<ShelfAlignment> { | 20 public testing::WithParamInterface<wm::ShelfAlignment> { |
21 public: | 21 public: |
22 KeyboardOverlayDelegateTest() : shelf_alignment_(GetParam()) {} | 22 KeyboardOverlayDelegateTest() : shelf_alignment_(GetParam()) {} |
23 virtual ~KeyboardOverlayDelegateTest() {} | 23 virtual ~KeyboardOverlayDelegateTest() {} |
24 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } | 24 wm::ShelfAlignment shelf_alignment() const { return shelf_alignment_; } |
25 | 25 |
26 private: | 26 private: |
27 ShelfAlignment shelf_alignment_; | 27 wm::ShelfAlignment shelf_alignment_; |
28 | 28 |
29 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegateTest); | 29 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegateTest); |
30 }; | 30 }; |
31 | 31 |
32 // Verifies we can show and close the widget for the overlay dialog. | 32 // Verifies we can show and close the widget for the overlay dialog. |
33 TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) { | 33 TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) { |
34 if (!SupportsMultipleDisplays()) | 34 if (!SupportsMultipleDisplays()) |
35 return; | 35 return; |
36 | 36 |
37 UpdateDisplay("500x400,300x200"); | 37 UpdateDisplay("500x400,300x200"); |
(...skipping 16 matching lines...) Expand all Loading... |
54 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x()); | 54 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x()); |
55 EXPECT_EQ(work_area.bottom(), bounds.bottom()); | 55 EXPECT_EQ(work_area.bottom(), bounds.bottom()); |
56 | 56 |
57 // Clean up. | 57 // Clean up. |
58 widget->CloseNow(); | 58 widget->CloseNow(); |
59 } | 59 } |
60 | 60 |
61 // Tests run three times - for all possible values of shelf alignment | 61 // Tests run three times - for all possible values of shelf alignment |
62 INSTANTIATE_TEST_CASE_P(ShelfAlignmentAny, | 62 INSTANTIATE_TEST_CASE_P(ShelfAlignmentAny, |
63 KeyboardOverlayDelegateTest, | 63 KeyboardOverlayDelegateTest, |
64 testing::Values(SHELF_ALIGNMENT_BOTTOM, | 64 testing::Values(wm::SHELF_ALIGNMENT_BOTTOM, |
65 SHELF_ALIGNMENT_LEFT, | 65 wm::SHELF_ALIGNMENT_LEFT, |
66 SHELF_ALIGNMENT_RIGHT, | 66 wm::SHELF_ALIGNMENT_RIGHT, |
67 SHELF_ALIGNMENT_BOTTOM_LOCKED)); | 67 wm::SHELF_ALIGNMENT_BOTTOM_LOCKED)); |
68 | 68 |
69 } // namespace ash | 69 } // namespace ash |
OLD | NEW |