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

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

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 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
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/wm/panels/panel_layout_manager_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/common/wm/dock/docked_window_resizer.h" 5 #include "ash/common/wm/dock/docked_window_resizer.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/shelf/shelf_types.h" 9 #include "ash/common/shelf/shelf_types.h"
10 #include "ash/common/shelf/shelf_widget.h" 10 #include "ash/common/shelf/shelf_widget.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 // Detach and drag down to shelf. 1364 // Detach and drag down to shelf.
1365 ASSERT_NO_FATAL_FAILURE(DragStart(w1.get())); 1365 ASSERT_NO_FATAL_FAILURE(DragStart(w1.get()));
1366 DragMove(-40, 0); 1366 DragMove(-40, 0);
1367 // Alignment is set to "NONE" when drag starts. 1367 // Alignment is set to "NONE" when drag starts.
1368 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager)); 1368 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager));
1369 // Release the mouse and the window should be no longer attached to the edge. 1369 // Release the mouse and the window should be no longer attached to the edge.
1370 DragEnd(); 1370 DragEnd();
1371 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager)); 1371 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager));
1372 1372
1373 // Drag down almost to shelf. A panel will snap, a regular window won't. 1373 // Drag down almost to shelf. A panel will snap, a regular window won't.
1374 ShelfWidget* shelf = GetPrimaryShelf()->GetShelfWidgetForTesting(); 1374 const int shelf_y =
1375 const int shelf_y = shelf->GetWindowBoundsInScreen().y(); 1375 GetPrimaryShelf()->shelf_widget()->GetWindowBoundsInScreen().y();
1376 const int kDistanceFromShelf = 10; 1376 const int kDistanceFromShelf = 10;
1377 ASSERT_NO_FATAL_FAILURE(DragStart(w1.get())); 1377 ASSERT_NO_FATAL_FAILURE(DragStart(w1.get()));
1378 DragMove(0, -kDistanceFromShelf + shelf_y - w1->bounds().bottom()); 1378 DragMove(0, -kDistanceFromShelf + shelf_y - w1->bounds().bottom());
1379 DragEnd(); 1379 DragEnd();
1380 if (test_panels()) { 1380 if (test_panels()) {
1381 // The panel should be touching the shelf and attached. 1381 // The panel should be touching the shelf and attached.
1382 EXPECT_EQ(shelf_y, w1->bounds().bottom()); 1382 EXPECT_EQ(shelf_y, w1->bounds().bottom());
1383 EXPECT_TRUE(wm::GetWindowState(w1.get())->panel_attached()); 1383 EXPECT_TRUE(wm::GetWindowState(w1.get())->panel_attached());
1384 } else { 1384 } else {
1385 // The window should not be touching the shelf. 1385 // The window should not be touching the shelf.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 EXPECT_TRUE(window_state->IsMaximized()); 1570 EXPECT_TRUE(window_state->IsMaximized());
1571 } 1571 }
1572 1572
1573 // Tests run twice - on both panels and normal windows 1573 // Tests run twice - on both panels and normal windows
1574 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 1574 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
1575 DockedWindowResizerTest, 1575 DockedWindowResizerTest,
1576 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 1576 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
1577 ui::wm::WINDOW_TYPE_PANEL)); 1577 ui::wm::WINDOW_TYPE_PANEL));
1578 1578
1579 } // namespace ash 1579 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698