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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | athena/screen/screen_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_unittest.cc
diff --git a/athena/home/home_card_unittest.cc b/athena/home/home_card_unittest.cc
index fb31f7ce707c3c8ded8785eb0a673562036d928f..9c4e80fa09e5e43682a4b309bf5af946a680f0eb 100644
--- a/athena/home/home_card_unittest.cc
+++ b/athena/home/home_card_unittest.cc
@@ -8,7 +8,9 @@
#include "athena/home/home_card_constants.h"
#include "athena/home/home_card_impl.h"
#include "athena/test/base/athena_test_base.h"
+#include "athena/test/base/test_windows.h"
#include "athena/wm/public/window_manager.h"
+#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/events/test/event_generator.h"
#include "ui/gfx/display.h"
@@ -298,4 +300,28 @@ TEST_F(HomeCardTest, KeyboardFocus) {
EXPECT_FALSE(IsSearchBoxFocused(home_card));
}
+TEST_F(HomeCardTest, DontMinimizeWithModalWindow) {
+ aura::Window* home_card = GetHomeCardWindow();
+
+ WindowManager::Get()->EnterOverview();
+ EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
+ EXPECT_TRUE(wm::IsActiveWindow(home_card));
+
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> modal(test::CreateTransientWindow(
+ &delegate, NULL, ui::MODAL_TYPE_SYSTEM, false));
+ modal->Show();
+ wm::ActivateWindow(modal.get());
+ EXPECT_TRUE(wm::IsActiveWindow(modal.get()));
+ 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.
+
+ modal.reset();
+
+ EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
+
+ // TODO(oshima): The focus should be set to home card. Flip the
+ // condition once crbug.com/424750 is fixed.a
+ EXPECT_FALSE(wm::IsActiveWindow(home_card));
+}
+
} // namespace athena
« 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