summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 03:38:34 +0000
committermgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 03:38:34 +0000
commit83d60231cd034ab573ff0b1a58f6a84ca86360e1 (patch)
tree7f6c6b54dd8564bc2c6c56c19b6b8abfe65c55a0 /ash
parent0aea6f1f6f4aff59261c9213f99fde663b921926 (diff)
downloadchromium_src-83d60231cd034ab573ff0b1a58f6a84ca86360e1.zip
chromium_src-83d60231cd034ab573ff0b1a58f6a84ca86360e1.tar.gz
chromium_src-83d60231cd034ab573ff0b1a58f6a84ca86360e1.tar.bz2
Fixed ChromeOS crash if app launcher is on a display that is destroyed.
BubbleDelegateView should not call OnAnchorBoundsChanged if the anchor is empty; this would have no effect anyway, but can cause a crash in a difficult-to-detect situation. Added test to AppListControllerTest. BUG=368990 TEST=Attach external monitor, open app launcher on external monitor, unplug external monitor. Should not crash. Review URL: https://codereview.chromium.org/267713004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/app_list_controller_unittest.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/ash/wm/app_list_controller_unittest.cc b/ash/wm/app_list_controller_unittest.cc
index 9808d8b..4946b8cf 100644
--- a/ash/wm/app_list_controller_unittest.cc
+++ b/ash/wm/app_list_controller_unittest.cc
@@ -89,4 +89,25 @@ TEST_F(AppListControllerTest, TapOutsideBubbleClosesBubble) {
EXPECT_FALSE(shell->GetAppListTargetVisibility());
}
+// Tests opening the app launcher on a non-primary display, then deleting the
+// display.
+TEST_F(AppListControllerTest, NonPrimaryDisplay) {
+ // Set up a screen with two displays (horizontally adjacent).
+ UpdateDisplay("800x600,800x600");
+
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
+ ASSERT_EQ(2u, root_windows.size());
+ aura::Window* secondary_window = root_windows[1];
+ EXPECT_EQ("800,0 800x600", secondary_window->GetBoundsInScreen().ToString());
+
+ Shell::GetInstance()->ToggleAppList(secondary_window);
+ EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility());
+
+ // Remove the secondary display. Shouldn't crash (http://crbug.com/368990).
+ UpdateDisplay("800x600");
+
+ // Updating the displays should close the app list.
+ EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility());
+}
+
} // namespace ash