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

Unified Diff: ash/shell/window_watcher_unittest.cc

Issue 10834185: A unit test that creates a situation that crashed (bug 130306) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include ordering Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/window_watcher_unittest.cc
diff --git a/ash/shell/window_watcher_unittest.cc b/ash/shell/window_watcher_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e35ba62429e886d78361c89b3b754232b847df65
--- /dev/null
+++ b/ash/shell/window_watcher_unittest.cc
@@ -0,0 +1,35 @@
+// 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
« no previous file with comments | « ash/ash.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698