OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/home/public/home_card.h" | 5 #include "athena/home/public/home_card.h" |
6 | 6 |
7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
9 #include "athena/test/athena_test_base.h" | 9 #include "athena/test/athena_test_base.h" |
10 #include "athena/wm/public/window_manager.h" | 10 #include "athena/wm/public/window_manager.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Swipe down to the minimized state. | 175 // Swipe down to the minimized state. |
176 generator.GestureScrollSequence(gfx::Point(x, 10), | 176 generator.GestureScrollSequence(gfx::Point(x, 10), |
177 gfx::Point(x, bottom - 1), | 177 gfx::Point(x, bottom - 1), |
178 base::TimeDelta::FromSeconds(1), | 178 base::TimeDelta::FromSeconds(1), |
179 10); | 179 10); |
180 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 180 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
181 EXPECT_FALSE(WindowManager::GetInstance()->IsOverviewModeActive()); | 181 EXPECT_FALSE(WindowManager::GetInstance()->IsOverviewModeActive()); |
182 | 182 |
183 } | 183 } |
184 | 184 |
| 185 TEST_F(HomeCardTest, GesturesToFullDirectly) { |
| 186 ASSERT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
| 187 ui::test::EventGenerator generator(root_window()); |
| 188 gfx::Rect screen_rect(root_window()->bounds()); |
| 189 |
| 190 const int bottom = screen_rect.bottom(); |
| 191 const int x = screen_rect.x() + 1; |
| 192 |
| 193 generator.GestureScrollSequence(gfx::Point(x, bottom - 1), |
| 194 gfx::Point(x, 20), |
| 195 base::TimeDelta::FromSeconds(1), |
| 196 10); |
| 197 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); |
| 198 EXPECT_TRUE(WindowManager::GetInstance()->IsOverviewModeActive()); |
| 199 } |
| 200 |
185 } // namespace athena | 201 } // namespace athena |
OLD | NEW |