| 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/home/home_card_constants.h" | 8 #include "athena/home/home_card_constants.h" |
| 9 #include "athena/home/home_card_impl.h" | 9 #include "athena/home/home_card_impl.h" |
| 10 #include "athena/home/home_card_view.h" | 10 #include "athena/home/home_card_view.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 // Swipe down slightly; nothing has to be changed. | 219 // Swipe down slightly; nothing has to be changed. |
| 220 generator.GestureScrollSequence(gfx::Point(x, bottom - 300), | 220 generator.GestureScrollSequence(gfx::Point(x, bottom - 300), |
| 221 gfx::Point(x, bottom - 250), | 221 gfx::Point(x, bottom - 250), |
| 222 base::TimeDelta::FromSeconds(1), | 222 base::TimeDelta::FromSeconds(1), |
| 223 10); | 223 10); |
| 224 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); | 224 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); |
| 225 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); | 225 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); |
| 226 | 226 |
| 227 // Swipe down to the bottom state. | 227 // Swipe down to the bottom state. |
| 228 generator.GestureScrollSequence(gfx::Point(x, 10), | 228 generator.GestureScrollSequence(gfx::Point(x, 50), |
| 229 gfx::Point(x, bottom - 120), | 229 gfx::Point(x, bottom - 120), |
| 230 base::TimeDelta::FromSeconds(1), | 230 base::TimeDelta::FromSeconds(1), |
| 231 10); | 231 10); |
| 232 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 232 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
| 233 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); | 233 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); |
| 234 | 234 |
| 235 generator.GestureScrollSequence(gfx::Point(x, bottom - 40), | 235 generator.GestureScrollSequence(gfx::Point(x, bottom - 40), |
| 236 gfx::Point(x, bottom - 300), | 236 gfx::Point(x, bottom - 300), |
| 237 base::TimeDelta::FromSeconds(1), | 237 base::TimeDelta::FromSeconds(1), |
| 238 10); | 238 10); |
| 239 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); | 239 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); |
| 240 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); | 240 EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive()); |
| 241 | 241 |
| 242 // Swipe down to the minimized state. | 242 // Swipe down to the minimized state. |
| 243 generator.GestureScrollSequence(gfx::Point(x, 10), | 243 generator.GestureScrollSequence(gfx::Point(x, 50), |
| 244 gfx::Point(x, bottom - 1), | 244 gfx::Point(x, bottom - 1), |
| 245 base::TimeDelta::FromSeconds(1), | 245 base::TimeDelta::FromSeconds(1), |
| 246 10); | 246 10); |
| 247 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 247 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
| 248 EXPECT_FALSE(WindowManager::Get()->IsOverviewModeActive()); | 248 EXPECT_FALSE(WindowManager::Get()->IsOverviewModeActive()); |
| 249 } | 249 } |
| 250 | 250 |
| 251 TEST_F(HomeCardTest, GesturesToFullDirectly) { | 251 TEST_F(HomeCardTest, GesturesToFullDirectly) { |
| 252 ASSERT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 252 ASSERT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
| 253 ui::test::EventGenerator generator(root_window()); | 253 ui::test::EventGenerator generator(root_window()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 contents_view->SetActivePage( | 313 contents_view->SetActivePage( |
| 314 contents_view->GetPageIndexForState(app_list::AppListModel::STATE_APPS)); | 314 contents_view->GetPageIndexForState(app_list::AppListModel::STATE_APPS)); |
| 315 EXPECT_EQ(app_list::AppListModel::STATE_APPS, model->state()); | 315 EXPECT_EQ(app_list::AppListModel::STATE_APPS, model->state()); |
| 316 WindowManager::Get()->ExitOverview(); | 316 WindowManager::Get()->ExitOverview(); |
| 317 WindowManager::Get()->EnterOverview(); | 317 WindowManager::Get()->EnterOverview(); |
| 318 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 318 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
| 319 EXPECT_EQ(app_list::AppListModel::STATE_START, model->state()); | 319 EXPECT_EQ(app_list::AppListModel::STATE_START, model->state()); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace athena | 322 } // namespace athena |
| OLD | NEW |