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

Side by Side Diff: ash/shelf/shelf_widget_unittest.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « ash/shelf/shelf_widget.cc ('k') | ash/shell.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/shelf/shelf_widget.h" 5 #include "ash/shelf/shelf_widget.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_delegate.h" 9 #include "ash/shelf/shelf_delegate.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 Shelf* shelf = Shelf::ForPrimaryDisplay(); 58 Shelf* shelf = Shelf::ForPrimaryDisplay();
59 UpdateDisplay("400x400"); 59 UpdateDisplay("400x400");
60 ASSERT_TRUE(shelf); 60 ASSERT_TRUE(shelf);
61 { 61 {
62 SCOPED_TRACE("Single Bottom"); 62 SCOPED_TRACE("Single Bottom");
63 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), 63 TestLauncherAlignment(Shell::GetPrimaryRootWindow(),
64 SHELF_ALIGNMENT_BOTTOM, 64 SHELF_ALIGNMENT_BOTTOM,
65 "0,0 400x353"); 65 "0,0 400x353");
66 } 66 }
67 { 67 {
68 SCOPED_TRACE("Single Locked");
69 TestLauncherAlignment(Shell::GetPrimaryRootWindow(),
70 SHELF_ALIGNMENT_BOTTOM_LOCKED, "0,0 400x353");
71 }
72 {
68 SCOPED_TRACE("Single Right"); 73 SCOPED_TRACE("Single Right");
69 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), 74 TestLauncherAlignment(Shell::GetPrimaryRootWindow(),
70 SHELF_ALIGNMENT_RIGHT, 75 SHELF_ALIGNMENT_RIGHT,
71 "0,0 353x400"); 76 "0,0 353x400");
72 } 77 }
73 { 78 {
74 SCOPED_TRACE("Single Left"); 79 SCOPED_TRACE("Single Left");
75 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), 80 TestLauncherAlignment(Shell::GetPrimaryRootWindow(),
76 SHELF_ALIGNMENT_LEFT, 81 SHELF_ALIGNMENT_LEFT,
77 "47,0 353x400"); 82 "47,0 353x400");
78 } 83 }
79 if (!SupportsMultipleDisplays()) 84 if (!SupportsMultipleDisplays())
80 return; 85 return;
81 86
82 UpdateDisplay("300x300,500x500"); 87 UpdateDisplay("300x300,500x500");
83 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 88 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
84 { 89 {
85 SCOPED_TRACE("Primary Bottom"); 90 SCOPED_TRACE("Primary Bottom");
86 TestLauncherAlignment(root_windows[0], 91 TestLauncherAlignment(root_windows[0],
87 SHELF_ALIGNMENT_BOTTOM, 92 SHELF_ALIGNMENT_BOTTOM,
88 "0,0 300x253"); 93 "0,0 300x253");
89 } 94 }
90 { 95 {
96 SCOPED_TRACE("Primary Locked");
97 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM_LOCKED,
98 "0,0 300x253");
99 }
100 {
91 SCOPED_TRACE("Primary Right"); 101 SCOPED_TRACE("Primary Right");
92 TestLauncherAlignment(root_windows[0], 102 TestLauncherAlignment(root_windows[0],
93 SHELF_ALIGNMENT_RIGHT, 103 SHELF_ALIGNMENT_RIGHT,
94 "0,0 253x300"); 104 "0,0 253x300");
95 } 105 }
96 { 106 {
97 SCOPED_TRACE("Primary Left"); 107 SCOPED_TRACE("Primary Left");
98 TestLauncherAlignment(root_windows[0], 108 TestLauncherAlignment(root_windows[0],
99 SHELF_ALIGNMENT_LEFT, 109 SHELF_ALIGNMENT_LEFT,
100 "47,0 253x300"); 110 "47,0 253x300");
101 } 111 }
102 { 112 {
103 SCOPED_TRACE("Secondary Bottom"); 113 SCOPED_TRACE("Secondary Bottom");
104 TestLauncherAlignment(root_windows[1], 114 TestLauncherAlignment(root_windows[1],
105 SHELF_ALIGNMENT_BOTTOM, 115 SHELF_ALIGNMENT_BOTTOM,
106 "300,0 500x453"); 116 "300,0 500x453");
107 } 117 }
108 { 118 {
119 SCOPED_TRACE("Secondary Locked");
120 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_BOTTOM_LOCKED,
121 "300,0 500x453");
122 }
123 {
109 SCOPED_TRACE("Secondary Right"); 124 SCOPED_TRACE("Secondary Right");
110 TestLauncherAlignment(root_windows[1], 125 TestLauncherAlignment(root_windows[1],
111 SHELF_ALIGNMENT_RIGHT, 126 SHELF_ALIGNMENT_RIGHT,
112 "300,0 453x500"); 127 "300,0 453x500");
113 } 128 }
114 { 129 {
115 SCOPED_TRACE("Secondary Left"); 130 SCOPED_TRACE("Secondary Left");
116 TestLauncherAlignment(root_windows[1], 131 TestLauncherAlignment(root_windows[1],
117 SHELF_ALIGNMENT_LEFT, 132 SHELF_ALIGNMENT_LEFT,
118 "347,0 453x500"); 133 "347,0 453x500");
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); 455 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN);
441 } 456 }
442 457
443 TEST_F(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysHideShelf) { 458 TEST_F(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysHideShelf) {
444 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. 459 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior.
445 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_RIGHT, 460 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_RIGHT,
446 SHELF_AUTO_HIDE_ALWAYS_HIDDEN, SHELF_HIDDEN, 461 SHELF_AUTO_HIDE_ALWAYS_HIDDEN, SHELF_HIDDEN,
447 SHELF_AUTO_HIDE_HIDDEN); 462 SHELF_AUTO_HIDE_HIDDEN);
448 } 463 }
449 464
465 TEST_F(ShelfWidgetTestWithDelegate, CreateLockedShelf) {
466 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior.
467 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM_LOCKED,
468 SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
469 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN);
470 }
471
450 } // namespace ash 472 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_widget.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698