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

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

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Pull forward a change from the dependant CL to this Created 6 years, 2 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_resizer.cc ('k') | ash/wm/drag_details.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/wm/dock/docked_window_resizer.h" 5 #include "ash/wm/dock/docked_window_resizer.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/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shelf/shelf.h" 10 #include "ash/shelf/shelf.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 wm::WindowState* window_state = wm::GetWindowState(window.get()); 502 wm::WindowState* window_state = wm::GetWindowState(window.get());
503 // Minimize the window, it should be hidden. 503 // Minimize the window, it should be hidden.
504 window_state->Minimize(); 504 window_state->Minimize();
505 RunAllPendingInMessageLoop(); 505 RunAllPendingInMessageLoop();
506 EXPECT_FALSE(window->IsVisible()); 506 EXPECT_FALSE(window->IsVisible());
507 EXPECT_TRUE(window_state->IsMinimized()); 507 EXPECT_TRUE(window_state->IsMinimized());
508 // Restore the window; window should be visible. 508 // Restore the window; window should be visible.
509 window_state->Restore(); 509 window_state->Restore();
510 RunAllPendingInMessageLoop(); 510 RunAllPendingInMessageLoop();
511 EXPECT_TRUE(window->IsVisible()); 511 EXPECT_TRUE(window->IsVisible());
512 EXPECT_TRUE(window_state->IsNormalStateType()); 512 EXPECT_TRUE(window_state->IsDocked());
513 } 513 }
514 514
515 // Maximize a docked window and check that it is maximized and no longer docked. 515 // Maximize a docked window and check that it is maximized and no longer docked.
516 TEST_P(DockedWindowResizerTest, AttachMaximize) { 516 TEST_P(DockedWindowResizerTest, AttachMaximize) {
517 if (!SupportsHostWindowResize()) 517 if (!SupportsHostWindowResize())
518 return; 518 return;
519 519
520 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); 520 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201)));
521 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); 521 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0);
522 522
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 EXPECT_TRUE(window_state->IsMaximized()); 1604 EXPECT_TRUE(window_state->IsMaximized());
1605 } 1605 }
1606 1606
1607 // Tests run twice - on both panels and normal windows 1607 // Tests run twice - on both panels and normal windows
1608 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 1608 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
1609 DockedWindowResizerTest, 1609 DockedWindowResizerTest,
1610 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 1610 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
1611 ui::wm::WINDOW_TYPE_PANEL)); 1611 ui::wm::WINDOW_TYPE_PANEL));
1612 1612
1613 } // namespace ash 1613 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_resizer.cc ('k') | ash/wm/drag_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698