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

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: rebase again, and 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
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 RETURN_IF_WIN8;
22
21 UpdateDisplay("500x400,300x200"); 23 UpdateDisplay("500x400,300x200");
22 KeyboardOverlayDelegate delegate(ASCIIToUTF16("Title"), 24 KeyboardOverlayDelegate delegate(ASCIIToUTF16("Title"),
23 GURL("chrome://keyboardoverlay/")); 25 GURL("chrome://keyboardoverlay/"));
24 // Showing the dialog creates a widget. 26 // Showing the dialog creates a widget.
25 views::Widget* widget = delegate.Show(NULL); 27 views::Widget* widget = delegate.Show(NULL);
26 EXPECT_TRUE(widget); 28 EXPECT_TRUE(widget);
27 29
28 // The widget is on the primary root window. 30 // The widget is on the primary root window.
29 EXPECT_EQ(Shell::GetPrimaryRootWindow(), 31 EXPECT_EQ(Shell::GetPrimaryRootWindow(),
30 widget->GetNativeWindow()->GetRootWindow()); 32 widget->GetNativeWindow()->GetRootWindow());
31 33
32 // The widget is horizontally centered at the bottom of the work area. 34 // The widget is horizontally centered at the bottom of the work area.
33 gfx::Rect work_area = Shell::GetScreen()->GetPrimaryDisplay().work_area(); 35 gfx::Rect work_area = Shell::GetScreen()->GetPrimaryDisplay().work_area();
34 gfx::Rect bounds = widget->GetRestoredBounds(); 36 gfx::Rect bounds = widget->GetRestoredBounds();
35 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x()); 37 EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x());
36 EXPECT_EQ(work_area.bottom(), bounds.bottom()); 38 EXPECT_EQ(work_area.bottom(), bounds.bottom());
37 39
38 // Clean up. 40 // Clean up.
39 widget->CloseNow(); 41 widget->CloseNow();
40 } 42 }
41 43
42 } // namespace ash 44 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698