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

Side by Side Diff: ash/wm/dock/docked_window_layout_manager_unittest.cc

Issue 1149153007: Ignores programmatic bounds changes for docked windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignores programmatic bounds changes for docked windows (comments) Created 5 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
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | no next file » | 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/wm/dock/docked_window_layout_manager.h" 5 #include "ash/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); 230 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0);
231 231
232 // The window should be attached and docked at the right edge. 232 // The window should be attached and docked at the right edge.
233 // Its width should shrink or grow to ideal width. 233 // Its width should shrink or grow to ideal width.
234 EXPECT_EQ(window->GetRootWindow()->bounds().right(), 234 EXPECT_EQ(window->GetRootWindow()->bounds().right(),
235 window->GetBoundsInScreen().right()); 235 window->GetBoundsInScreen().right());
236 EXPECT_EQ(ideal_width(), window->bounds().width()); 236 EXPECT_EQ(ideal_width(), window->bounds().width());
237 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id()); 237 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
238 } 238 }
239 239
240 // Tests that a docked window's bounds cannot be changed programmatically.
241 TEST_P(DockedWindowLayoutManagerTest, DockedWindowBoundsDontChange) {
242 if (!SupportsHostWindowResize())
243 return;
244
245 gfx::Rect bounds(0, 0, 201, 201);
246 scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
247 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0);
248
249 // The window should be attached and docked at the right edge.
250 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
251
252 bounds = window->GetBoundsInScreen();
253 window->SetBounds(gfx::Rect(210, 210, 210, 210));
254 EXPECT_EQ(bounds.ToString(), window->GetBoundsInScreen().ToString());
255 }
256
240 // Tests that with a window docked on the left the auto-placing logic in 257 // Tests that with a window docked on the left the auto-placing logic in
241 // RearrangeVisibleWindowOnShow places windows flush with work area edges. 258 // RearrangeVisibleWindowOnShow places windows flush with work area edges.
242 TEST_P(DockedWindowLayoutManagerTest, AutoPlacingLeft) { 259 TEST_P(DockedWindowLayoutManagerTest, AutoPlacingLeft) {
243 if (!SupportsHostWindowResize()) 260 if (!SupportsHostWindowResize())
244 return; 261 return;
245 262
246 gfx::Rect bounds(0, 0, 201, 201); 263 gfx::Rect bounds(0, 0, 201, 201);
247 scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); 264 scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
248 DragRelativeToEdge(DOCKED_EDGE_LEFT, window.get(), 0); 265 DragRelativeToEdge(DOCKED_EDGE_LEFT, window.get(), 0);
249 266
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); 851 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height());
835 } 852 }
836 853
837 // Tests run twice - on both panels and normal windows 854 // Tests run twice - on both panels and normal windows
838 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 855 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
839 DockedWindowLayoutManagerTest, 856 DockedWindowLayoutManagerTest,
840 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 857 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
841 ui::wm::WINDOW_TYPE_PANEL)); 858 ui::wm::WINDOW_TYPE_PANEL));
842 859
843 } // namespace ash 860 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698