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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2101843003: [ash-md] Animates a window closed while in overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Animates a window closed while in overview mode Created 4 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/aura/wm_window_aura.h" 8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/accessibility_delegate.h" 9 #include "ash/common/accessibility_delegate.h"
10 #include "ash/common/accessibility_types.h" 10 #include "ash/common/accessibility_types.h"
11 #include "ash/common/ash_switches.h" 11 #include "ash/common/ash_switches.h"
12 #include "ash/common/material_design/material_design_controller.h" 12 #include "ash/common/material_design/material_design_controller.h"
13 #include "ash/common/shell_window_ids.h" 13 #include "ash/common/shell_window_ids.h"
14 #include "ash/common/wm/mru_window_tracker.h" 14 #include "ash/common/wm/mru_window_tracker.h"
15 #include "ash/common/wm/overview/scoped_transform_overview_window.h"
15 #include "ash/common/wm/overview/window_grid.h" 16 #include "ash/common/wm/overview/window_grid.h"
16 #include "ash/common/wm/overview/window_selector.h" 17 #include "ash/common/wm/overview/window_selector.h"
17 #include "ash/common/wm/overview/window_selector_controller.h" 18 #include "ash/common/wm/overview/window_selector_controller.h"
18 #include "ash/common/wm/overview/window_selector_item.h" 19 #include "ash/common/wm/overview/window_selector_item.h"
19 #include "ash/common/wm/panels/panel_layout_manager.h" 20 #include "ash/common/wm/panels/panel_layout_manager.h"
20 #include "ash/common/wm/window_state.h" 21 #include "ash/common/wm/window_state.h"
21 #include "ash/common/wm/wm_event.h" 22 #include "ash/common/wm/wm_event.h"
22 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
23 #include "ash/drag_drop/drag_drop_controller.h" 24 #include "ash/drag_drop/drag_drop_controller.h"
24 #include "ash/root_window_controller.h" 25 #include "ash/root_window_controller.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 new test::MaterialDesignControllerTestAPI(GetParam())); 116 new test::MaterialDesignControllerTestAPI(GetParam()));
116 if (!ash::MaterialDesignController::IsOverviewMaterial()) { 117 if (!ash::MaterialDesignController::IsOverviewMaterial()) {
117 base::CommandLine::ForCurrentProcess()->AppendSwitch( 118 base::CommandLine::ForCurrentProcess()->AppendSwitch(
118 switches::kAshEnableStableOverviewOrder); 119 switches::kAshEnableStableOverviewOrder);
119 } 120 }
120 ASSERT_TRUE(test::TestShelfDelegate::instance()); 121 ASSERT_TRUE(test::TestShelfDelegate::instance());
121 122
122 shelf_view_test_.reset(new test::ShelfViewTestAPI( 123 shelf_view_test_.reset(new test::ShelfViewTestAPI(
123 test::ShelfTestAPI(Shelf::ForPrimaryDisplay()).shelf_view())); 124 test::ShelfTestAPI(Shelf::ForPrimaryDisplay()).shelf_view()));
124 shelf_view_test_->SetAnimationDuration(1); 125 shelf_view_test_->SetAnimationDuration(1);
126 ScopedTransformOverviewWindow::SetImmediateCloseForTests();
tdanderson 2016/06/28 15:28:02 I will defer to Ben for any comments related to te
varkha 2016/06/28 23:50:37 Acknowledged.
125 } 127 }
126 128
127 void TearDown() override { 129 void TearDown() override {
128 material_design_state_.reset(); 130 material_design_state_.reset();
129 test::AshTestBase::TearDown(); 131 test::AshTestBase::TearDown();
130 } 132 }
131 133
132 aura::Window* CreateWindow(const gfx::Rect& bounds) { 134 aura::Window* CreateWindow(const gfx::Rect& bounds) {
133 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds); 135 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds);
134 } 136 }
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 bounds.y()); 1829 bounds.y());
1828 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); 1830 EXPECT_LE(transformed_rect.bottom(), bounds.bottom());
1829 EXPECT_NEAR(transformed_rect.x() - bounds.x(), 1831 EXPECT_NEAR(transformed_rect.x() - bounds.x(),
1830 bounds.right() - transformed_rect.right(), 1); 1832 bounds.right() - transformed_rect.right(), 1);
1831 EXPECT_NEAR( 1833 EXPECT_NEAR(
1832 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), 1834 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(),
1833 bounds.bottom() - transformed_rect.bottom(), 1); 1835 bounds.bottom() - transformed_rect.bottom(), 1);
1834 } 1836 }
1835 1837
1836 } // namespace ash 1838 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698