diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-04 03:27:29 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-04 03:27:29 +0000 |
commit | 023813461a28567adabab843e098bc1ca0f3dc23 (patch) | |
tree | 83128ed206437ac66f11aa19025d56e9f71a0815 /ash/wm/app_list_controller_unittest.cc | |
parent | e9a71317209f27bb07ccd72d34e6c40e8469556f (diff) | |
download | chromium_src-023813461a28567adabab843e098bc1ca0f3dc23.zip chromium_src-023813461a28567adabab843e098bc1ca0f3dc23.tar.gz chromium_src-023813461a28567adabab843e098bc1ca0f3dc23.tar.bz2 |
ash: Fix app launcher closing on uninstall dialog.
BUG=303267,276513
TEST=Covered by AppListControllerTest.*
R=flackr@chromium.org, jamescook@chromium.org
Review URL: https://codereview.chromium.org/25708010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller_unittest.cc')
-rw-r--r-- | ash/wm/app_list_controller_unittest.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ash/wm/app_list_controller_unittest.cc b/ash/wm/app_list_controller_unittest.cc new file mode 100644 index 0000000..5d37048 --- /dev/null +++ b/ash/wm/app_list_controller_unittest.cc @@ -0,0 +1,45 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/shell.h" +#include "ash/shell_window_ids.h" +#include "ash/test/ash_test_base.h" +#include "ash/test/test_shell_delegate.h" +#include "ash/wm/window_util.h" +#include "base/memory/scoped_ptr.h" +#include "ui/aura/test/test_windows.h" +#include "ui/aura/window.h" + +namespace ash { + +typedef test::AshTestBase AppListControllerTest; + +// Tests that app launcher hides when focus moves to a normal window. +TEST_F(AppListControllerTest, HideOnFocusOut) { + Shell::GetInstance()->ToggleAppList(NULL); + EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); + + scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); + wm::ActivateWindow(window.get()); + + EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); +} + +// Tests that app launcher remains visible when focus is moved to a different +// window in kShellWindowId_AppListContainer. +TEST_F(AppListControllerTest, RemainVisibleWhenFocusingToApplistContainer) { + Shell::GetInstance()->ToggleAppList(NULL); + EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); + + aura::Window* applist_container = Shell::GetContainer( + Shell::GetPrimaryRootWindow(), + internal::kShellWindowId_AppListContainer); + scoped_ptr<aura::Window> window( + aura::test::CreateTestWindowWithId(0, applist_container)); + wm::ActivateWindow(window.get()); + + EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); +} + +} // namespace ash |