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" |
11 #include "athena/test/base/test_windows.h" | |
11 #include "athena/wm/public/window_manager.h" | 12 #include "athena/wm/public/window_manager.h" |
13 #include "ui/aura/test/test_window_delegate.h" | |
12 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
13 #include "ui/events/test/event_generator.h" | 15 #include "ui/events/test/event_generator.h" |
14 #include "ui/gfx/display.h" | 16 #include "ui/gfx/display.h" |
15 #include "ui/gfx/screen.h" | 17 #include "ui/gfx/screen.h" |
16 #include "ui/views/controls/textfield/textfield.h" | 18 #include "ui/views/controls/textfield/textfield.h" |
17 #include "ui/views/focus/focus_manager.h" | 19 #include "ui/views/focus/focus_manager.h" |
18 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
19 #include "ui/wm/core/shadow_types.h" | 21 #include "ui/wm/core/shadow_types.h" |
20 #include "ui/wm/core/window_util.h" | 22 #include "ui/wm/core/window_util.h" |
21 | 23 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 EXPECT_TRUE(IsSearchBoxFocused(home_card)); | 293 EXPECT_TRUE(IsSearchBoxFocused(home_card)); |
292 | 294 |
293 generator.GestureScrollSequence(gfx::Point(x, 10), | 295 generator.GestureScrollSequence(gfx::Point(x, 10), |
294 gfx::Point(x, bottom - 100), | 296 gfx::Point(x, bottom - 100), |
295 base::TimeDelta::FromSeconds(1), | 297 base::TimeDelta::FromSeconds(1), |
296 10); | 298 10); |
297 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | 299 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); |
298 EXPECT_FALSE(IsSearchBoxFocused(home_card)); | 300 EXPECT_FALSE(IsSearchBoxFocused(home_card)); |
299 } | 301 } |
300 | 302 |
303 TEST_F(HomeCardTest, DontMinimizeWithModalWindow) { | |
304 aura::Window* home_card = GetHomeCardWindow(); | |
305 | |
306 WindowManager::Get()->EnterOverview(); | |
307 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | |
308 EXPECT_TRUE(wm::IsActiveWindow(home_card)); | |
309 | |
310 aura::test::TestWindowDelegate delegate; | |
311 scoped_ptr<aura::Window> modal(test::CreateTransientWindow( | |
312 &delegate, NULL, ui::MODAL_TYPE_SYSTEM, false)); | |
313 modal->Show(); | |
314 wm::ActivateWindow(modal.get()); | |
315 EXPECT_TRUE(wm::IsActiveWindow(modal.get())); | |
316 EXPECT_FALSE(wm::IsActiveWindow(home_card)); | |
Jun Mukai
2014/10/17 22:30:25
It's better to make an expectation of home card st
oshima
2014/10/17 23:05:57
makes sense. done.
| |
317 | |
318 modal.reset(); | |
319 | |
320 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); | |
321 | |
322 // TODO(oshima): The focus should be set to home card. Flip the | |
323 // condition once crbug.com/424750 is fixed.a | |
324 EXPECT_FALSE(wm::IsActiveWindow(home_card)); | |
325 } | |
326 | |
301 } // namespace athena | 327 } // namespace athena |
OLD | NEW |