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

Side by Side Diff: athena/home/home_card_unittest.cc

Issue 651773003: Test the home card stays bottom after activation change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | athena/screen/screen_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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));
317 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
318
319 modal.reset();
320
321 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
322
323 // TODO(oshima): The focus should be set to home card. Flip the
324 // condition once crbug.com/424750 is fixed.a
325 EXPECT_FALSE(wm::IsActiveWindow(home_card));
326 }
327
301 } // namespace athena 328 } // namespace athena
OLDNEW
« no previous file with comments | « no previous file | athena/screen/screen_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698