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

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

Issue 414133002: Revert 285393 "Exit overview mode when a new activity is opened ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/athena/wm/window_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/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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 TEST_F(HomeCardTest, AppSelection) { 50 TEST_F(HomeCardTest, AppSelection) {
51 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); 51 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
52 52
53 WindowManager::GetInstance()->ToggleOverview(); 53 WindowManager::GetInstance()->ToggleOverview();
54 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); 54 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
55 55
56 athena::ActivityManager::Get()->AddActivity( 56 athena::ActivityManager::Get()->AddActivity(
57 athena::ActivityFactory::Get()->CreateWebActivity( 57 athena::ActivityFactory::Get()->CreateWebActivity(
58 NULL, GURL("http://www.google.com/"))); 58 NULL, GURL("http://www.google.com/")));
59 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); 59 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
60
61 // Overview mode has to finish before ending test, otherwise it crashes.
62 // TODO(mukai): fix this.
63 WindowManager::GetInstance()->ToggleOverview();
60 } 64 }
61 65
62 TEST_F(HomeCardTest, Accelerators) { 66 TEST_F(HomeCardTest, Accelerators) {
63 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); 67 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
64 68
65 aura::test::EventGenerator generator(root_window()); 69 aura::test::EventGenerator generator(root_window());
66 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); 70 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
67 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); 71 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
68 72
69 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); 73 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
70 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); 74 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
71 75
72 // Do nothing for BOTTOM. 76 // Do nothing for BOTTOM.
73 WindowManager::GetInstance()->ToggleOverview(); 77 WindowManager::GetInstance()->ToggleOverview();
74 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); 78 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
75 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); 79 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
76 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState()); 80 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
77 81
78 // Do nothing if the centered state is a temporary state. 82 // Do nothing if the centered state is a temporary state.
79 HomeCard::Get()->UpdateVirtualKeyboardBounds(gfx::Rect(0, 0, 100, 100)); 83 HomeCard::Get()->UpdateVirtualKeyboardBounds(gfx::Rect(0, 0, 100, 100));
80 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); 84 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
81 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); 85 generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
82 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); 86 EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
87
88 // Overview mode has to finish before ending test, otherwise it crashes.
89 // TODO(mukai): fix this.
90 WindowManager::GetInstance()->ToggleOverview();
83 } 91 }
84 92
85 } // namespace athena 93 } // namespace athena
OLDNEW
« no previous file with comments | « no previous file | trunk/src/athena/wm/window_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698