Commit 246c2e88 authored by harrym@chromium.org's avatar harrym@chromium.org

A unit test that creates a situation that crashed (bug 130306)

verifying that ash_shell terminates successfully when a 
window watcher is attached.

BUG=130332


Review URL: https://chromiumcodereview.appspot.com/10834185

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150709 0039d316-1c4b-4281-b951-d872f2087c98
parent 8d8871a8
......@@ -395,12 +395,14 @@
'../third_party/icu/icu.gyp:icuuc',
'../ui/aura/aura.gyp:aura',
'../ui/aura/aura.gyp:test_support_aura',
'../ui/app_list/app_list.gyp:app_list',
'../ui/compositor/compositor.gyp:compositor',
'../ui/compositor/compositor.gyp:compositor_test_support',
'../ui/ui.gyp:ui',
'../ui/ui.gyp:ui_resources',
'../ui/ui.gyp:ui_test_support',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_examples_lib',
'../ui/views/views.gyp:test_support_views',
'ash',
],
......@@ -427,6 +429,17 @@
'screen_ash_unittest.cc',
'screensaver/screensaver_view_unittest.cc',
'shell_unittest.cc',
'shell/app_list.cc',
'shell/bubble.cc',
'shell/launcher_delegate_impl.cc',
'shell/lock_view.cc',
'shell/panel_window.cc',
'shell/shell_delegate_impl.cc',
'shell/toplevel_window.cc',
'shell/widgets.cc',
'shell/window_type_launcher.cc',
'shell/window_watcher.cc',
'shell/window_watcher_unittest.cc',
'system/tray/system_tray_unittest.cc',
'system/web_notification/web_notification_tray_unittest.cc',
'test/ash_test_base.cc',
......
// Copyright (c) 2012 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/window_watcher.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell/shell_delegate_impl.h"
#include "ash/test/ash_test_base.h"
#include "ui/aura/root_window.h"
namespace ash {
typedef test::AshTestBase WindowWatcherTest;
// This test verifies that shell can be torn down without causing failures
// bug http://code.google.com/p/chromium/issues/detail?id=130332
TEST_F(WindowWatcherTest, ShellDeleteInstance) {
scoped_ptr<ash::shell::WindowWatcher> window_watcher;
Shell::DeleteInstance();
shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl;
Shell::CreateInstance(delegate);
Shell::GetPrimaryRootWindow()->ShowRootWindow();
window_watcher.reset(new ash::shell::WindowWatcher);
delegate->SetWatcher(window_watcher.get());
Shell::GetPrimaryRootWindow()->Hide();
window_watcher.reset();
delegate->SetWatcher(NULL);
}
} // namespace ash
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment