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/test/base/athena_test_base.h" | 10 #include "athena/test/base/athena_test_base.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 | 103 |
104 // Verify if the home card is correctly minimized after app launch. | 104 // Verify if the home card is correctly minimized after app launch. |
105 TEST_F(HomeCardTest, AppSelection) { | 105 TEST_F(HomeCardTest, AppSelection) { |
106 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 106 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
107 | 107 |
108 WindowManager::Get()->EnterOverview(); | 108 WindowManager::Get()->EnterOverview(); |
109 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 109 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
110 | 110 |
111 athena::ActivityFactory::Get()->CreateWebActivity( | 111 athena::ActivityFactory::Get()->CreateWebActivity( |
112 NULL, base::string16(), GURL("http://www.google.com/")); | 112 nullptr, base::string16(), GURL("http://www.google.com/")); |
113 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 113 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
114 } | 114 } |
115 | 115 |
116 TEST_F(HomeCardTest, Accelerators) { | 116 TEST_F(HomeCardTest, Accelerators) { |
117 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); | 117 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); |
118 | 118 |
119 ui::test::EventGenerator generator(root_window()); | 119 ui::test::EventGenerator generator(root_window()); |
120 | 120 |
121 // CTRL+L toggles centered home card, check that overview mode follows | 121 // CTRL+L toggles centered home card, check that overview mode follows |
122 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); | 122 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 TEST_F(HomeCardTest, DontMinimizeWithModalWindow) { | 303 TEST_F(HomeCardTest, DontMinimizeWithModalWindow) { |
304 aura::Window* home_card = GetHomeCardWindow(); | 304 aura::Window* home_card = GetHomeCardWindow(); |
305 | 305 |
306 WindowManager::Get()->EnterOverview(); | 306 WindowManager::Get()->EnterOverview(); |
307 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 307 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
308 EXPECT_TRUE(wm::IsActiveWindow(home_card)); | 308 EXPECT_TRUE(wm::IsActiveWindow(home_card)); |
309 | 309 |
310 aura::test::TestWindowDelegate delegate; | 310 aura::test::TestWindowDelegate delegate; |
311 scoped_ptr<aura::Window> modal(test::CreateTransientWindow( | 311 scoped_ptr<aura::Window> modal(test::CreateTransientWindow( |
312 &delegate, NULL, ui::MODAL_TYPE_SYSTEM, false)); | 312 &delegate, nullptr, ui::MODAL_TYPE_SYSTEM, false)); |
313 modal->Show(); | 313 modal->Show(); |
314 wm::ActivateWindow(modal.get()); | 314 wm::ActivateWindow(modal.get()); |
315 EXPECT_TRUE(wm::IsActiveWindow(modal.get())); | 315 EXPECT_TRUE(wm::IsActiveWindow(modal.get())); |
316 EXPECT_FALSE(wm::IsActiveWindow(home_card)); | 316 EXPECT_FALSE(wm::IsActiveWindow(home_card)); |
317 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 317 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
318 | 318 |
319 modal.reset(); | 319 modal.reset(); |
320 | 320 |
321 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 321 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
322 | 322 |
323 // TODO(oshima): The focus should be set to home card. Flip the | 323 // TODO(oshima): The focus should be set to home card. Flip the |
324 // condition once crbug.com/424750 is fixed.a | 324 // condition once crbug.com/424750 is fixed.a |
325 EXPECT_FALSE(wm::IsActiveWindow(home_card)); | 325 EXPECT_FALSE(wm::IsActiveWindow(home_card)); |
326 } | 326 } |
327 | 327 |
328 } // namespace athena | 328 } // namespace athena |
OLD | NEW |