Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: ash/keyboard_overlay/keyboard_overlay_delegate_unittest.cc

Issue 16539005: Skip mulitple-dispay tests on win8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/keyboard_overlay/keyboard_overlay_delegate.h" 5 #include "ash/keyboard_overlay/keyboard_overlay_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 #include "ui/gfx/display.h" 11 #include "ui/gfx/display.h"
12 #include "ui/gfx/screen.h" 12 #include "ui/gfx/screen.h"
13 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
14 14
15 namespace ash { 15 namespace ash {
16 16
17 typedef test::AshTestBase KeyboardOverlayDelegateTest; 17 typedef test::AshTestBase KeyboardOverlayDelegateTest;
18 18
19 // Verifies we can show and close the widget for the overlay dialog. 19 // Verifies we can show and close the widget for the overlay dialog.
20 TEST_F(KeyboardOverlayDelegateTest, ShowAndClose) { 20 TEST_F(KeyboardOverlayDelegateTest, ShowAndClose) {
21 if (!SupportsMultipleDisplays())
22 return;
23
21 UpdateDisplay("500x400,300x200"); 24 UpdateDisplay("500x400,300x200");
22 KeyboardOverlayDelegate delegate(ASCIIToUTF16("Title"), 25 KeyboardOverlayDelegate delegate(ASCIIToUTF16("Title"),
23 GURL("chrome://keyboardoverlay/")); 26 GURL("chrome://keyboardoverlay/"));
24 // Showing the dialog creates a widget. 27 // Showing the dialog creates a widget.
25 views::Widget* widget = delegate.Show(NULL); 28 views::Widget* widget = delegate.Show(NULL);
26 EXPECT_TRUE(widget); 29 EXPECT_TRUE(widget);
27 30
28 // The widget is on the primary root window. 31 // The widget is on the primary root window.
29 EXPECT_EQ(Shell::GetPrimaryRootWindow(), 32 EXPECT_EQ(Shell::GetPrimaryRootWindow(),
30 widget->GetNativeWindow()->GetRootWindow()); 33 widget->GetNativeWindow()->GetRootWindow());
31 34
32 // The widget is horizontally centered at the bottom of the work area. 35 // The widget is horizontally centered at the bottom of the work area.
33 gfx::Rect work_area = Shell::GetScreen()->GetPrimaryDisplay().work_area(); 36 gfx::Rect work_area = Shell::GetScreen()->GetPrimaryDisplay().work_area();
34 gfx::Rect bounds = widget->GetRestoredBounds(); 37 gfx::Rect bounds = widget->GetRestoredBounds();
35 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x()); 38 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x());
36 EXPECT_EQ(work_area.bottom(), bounds.bottom()); 39 EXPECT_EQ(work_area.bottom(), bounds.bottom());
37 40
38 // Clean up. 41 // Clean up.
39 widget->CloseNow(); 42 widget->CloseNow();
40 } 43 }
41 44
42 } // namespace ash 45 } // namespace ash
OLDNEW
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698