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

Unified Diff: ash/shell_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: 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
« ash/ash.gyp ('K') | « 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_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 3bf6cf396e6a73212c21799e4791a84c0256ed6c..10be8880106d6a7831edf5131b008b909fbb1e3e 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -7,6 +7,8 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
+#include "ash/shell/shell_delegate_impl.h"
+#include "ash/shell/window_watcher.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/root_window_layout_manager.h"
#include "ash/wm/shelf_layout_manager.h"
@@ -339,4 +341,32 @@ TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
window_->Init(ui::LAYER_NOT_DRAWN);
}
+#if defined(OS_LINUX) && defined(OS_CHROMEOS)
sky 2012/08/06 21:21:22 Why is this specific to linux and chromeos?
Harry McCleave 2012/08/07 18:17:23 Done.
+class WindowWatcherTest : public test::AshTestBase {
sky 2012/08/06 21:21:22 This test is testing WindowWatcher and not so much
Harry McCleave 2012/08/07 18:17:23 Done.
+public:
sky 2012/08/06 21:21:22 nit: spacing is off here, 350 and 353. These shoul
Harry McCleave 2012/08/07 18:17:23 Done.
+ WindowWatcherTest() {}
+ virtual ~WindowWatcherTest() {}
+
+protected:
+ scoped_ptr<ash::shell::WindowWatcher> window_watcher_;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(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) {
+ 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();
sky 2012/08/06 21:21:22 Don't you need to do a elegate->SetWatcher(NULL) t
Harry McCleave 2012/08/07 18:17:23 Done. Oddly in this case you don't as the desctruc
+}
+#endif
} // namespace ash
« ash/ash.gyp ('K') | « ash/ash.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698