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

Side by Side Diff: ash/screen_ash_unittest.cc

Issue 22793011: ash:Shelf - Enable Alternate Shelf and Side Shelf by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missed rm #include Created 7 years, 3 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) 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/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 22 matching lines...) Expand all
33 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); 33 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100));
34 primary->Show(); 34 primary->Show();
35 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( 35 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds(
36 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); 36 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100));
37 secondary->Show(); 37 secondary->Show();
38 38
39 // Maximized bounds 39 // Maximized bounds
40 EXPECT_EQ("0,0 600x597", 40 EXPECT_EQ("0,0 600x597",
41 ScreenAsh::GetMaximizedWindowBoundsInParent( 41 ScreenAsh::GetMaximizedWindowBoundsInParent(
42 primary->GetNativeView()).ToString()); 42 primary->GetNativeView()).ToString());
43 EXPECT_EQ("0,0 500x452", 43 EXPECT_EQ("0,0 500x453",
44 ScreenAsh::GetMaximizedWindowBoundsInParent( 44 ScreenAsh::GetMaximizedWindowBoundsInParent(
45 secondary->GetNativeView()).ToString()); 45 secondary->GetNativeView()).ToString());
46 46
47 // Display bounds 47 // Display bounds
48 EXPECT_EQ("0,0 600x600", 48 EXPECT_EQ("0,0 600x600",
49 ScreenAsh::GetDisplayBoundsInParent( 49 ScreenAsh::GetDisplayBoundsInParent(
50 primary->GetNativeView()).ToString()); 50 primary->GetNativeView()).ToString());
51 EXPECT_EQ("0,0 500x500", 51 EXPECT_EQ("0,0 500x500",
52 ScreenAsh::GetDisplayBoundsInParent( 52 ScreenAsh::GetDisplayBoundsInParent(
53 secondary->GetNativeView()).ToString()); 53 secondary->GetNativeView()).ToString());
54 54
55 // Work area bounds 55 // Work area bounds
56 EXPECT_EQ("0,0 600x597", 56 EXPECT_EQ("0,0 600x597",
57 ScreenAsh::GetDisplayWorkAreaBoundsInParent( 57 ScreenAsh::GetDisplayWorkAreaBoundsInParent(
58 primary->GetNativeView()).ToString()); 58 primary->GetNativeView()).ToString());
59 EXPECT_EQ("0,0 500x452", 59 EXPECT_EQ("0,0 500x453",
60 ScreenAsh::GetDisplayWorkAreaBoundsInParent( 60 ScreenAsh::GetDisplayWorkAreaBoundsInParent(
61 secondary->GetNativeView()).ToString()); 61 secondary->GetNativeView()).ToString());
62 } 62 }
63 63
64 // Test verifies a stable handling of secondary screen widget changes 64 // Test verifies a stable handling of secondary screen widget changes
65 // (crbug.com/226132). 65 // (crbug.com/226132).
66 TEST_F(ScreenAshTest, StabilityTest) { 66 TEST_F(ScreenAshTest, StabilityTest) {
67 if (!SupportsMultipleDisplays()) 67 if (!SupportsMultipleDisplays())
68 return; 68 return;
69 69
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ScreenAsh::ConvertRectToScreen( 107 ScreenAsh::ConvertRectToScreen(
108 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); 108 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString());
109 EXPECT_EQ( 109 EXPECT_EQ(
110 "650,50 100x100", 110 "650,50 100x100",
111 ScreenAsh::ConvertRectToScreen( 111 ScreenAsh::ConvertRectToScreen(
112 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); 112 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString());
113 } 113 }
114 114
115 } // namespace test 115 } // namespace test
116 } // namespace ash 116 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698