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/common/shelf/shelf.h" | |
8 #include "ash/common/shelf/shelf_types.h" | 7 #include "ash/common/shelf/shelf_types.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
13 #include "ui/display/display.h" | 13 #include "ui/display/display.h" |
14 #include "ui/display/screen.h" | 14 #include "ui/display/screen.h" |
15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
(...skipping 10 matching lines...) Expand all Loading... |
29 | 29 |
30 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegateTest); | 30 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegateTest); |
31 }; | 31 }; |
32 | 32 |
33 // Verifies we can show and close the widget for the overlay dialog. | 33 // Verifies we can show and close the widget for the overlay dialog. |
34 TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) { | 34 TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) { |
35 if (!SupportsMultipleDisplays()) | 35 if (!SupportsMultipleDisplays()) |
36 return; | 36 return; |
37 | 37 |
38 UpdateDisplay("500x400,300x200"); | 38 UpdateDisplay("500x400,300x200"); |
39 Shelf::ForPrimaryDisplay()->SetAlignment(shelf_alignment()); | 39 GetPrimaryShelf()->SetAlignment(shelf_alignment()); |
40 KeyboardOverlayDelegate delegate(base::ASCIIToUTF16("Title"), | 40 KeyboardOverlayDelegate delegate(base::ASCIIToUTF16("Title"), |
41 GURL("chrome://keyboardoverlay/")); | 41 GURL("chrome://keyboardoverlay/")); |
42 // Showing the dialog creates a widget. | 42 // Showing the dialog creates a widget. |
43 views::Widget* widget = delegate.Show(NULL); | 43 views::Widget* widget = delegate.Show(NULL); |
44 EXPECT_TRUE(widget); | 44 EXPECT_TRUE(widget); |
45 | 45 |
46 // The widget is on the primary root window. | 46 // The widget is on the primary root window. |
47 EXPECT_EQ(Shell::GetPrimaryRootWindow(), | 47 EXPECT_EQ(Shell::GetPrimaryRootWindow(), |
48 widget->GetNativeWindow()->GetRootWindow()); | 48 widget->GetNativeWindow()->GetRootWindow()); |
49 | 49 |
(...skipping 10 matching lines...) Expand all Loading... |
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(SHELF_ALIGNMENT_BOTTOM, |
65 SHELF_ALIGNMENT_LEFT, | 65 SHELF_ALIGNMENT_LEFT, |
66 SHELF_ALIGNMENT_RIGHT, | 66 SHELF_ALIGNMENT_RIGHT, |
67 SHELF_ALIGNMENT_BOTTOM_LOCKED)); | 67 SHELF_ALIGNMENT_BOTTOM_LOCKED)); |
68 | 68 |
69 } // namespace ash | 69 } // namespace ash |
OLD | NEW |