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

Unified Diff: ash/wm/screen_dimmer_unittest.cc

Issue 2359633003: Makes ScreenDimmer deal with the shell going away (Closed)
Patch Set: comment Created 4 years, 3 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/common/wm/screen_dimmer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/screen_dimmer_unittest.cc
diff --git a/ash/wm/screen_dimmer_unittest.cc b/ash/wm/screen_dimmer_unittest.cc
index 336b47b1c52ecbba119ff5b74bb0431caac1314b..8ed00ae0ec776f962aa1d029964f5294813538d9 100644
--- a/ash/wm/screen_dimmer_unittest.cc
+++ b/ash/wm/screen_dimmer_unittest.cc
@@ -120,5 +120,27 @@ TEST_F(ScreenDimmerTest, DimAtBottom) {
EXPECT_EQ(*dim_iter, *root_window->children().begin());
}
+// See description above TEST_F for details.
+class ScreenDimmerShellDestructionTest : public AshTestBase {
+ public:
+ ScreenDimmerShellDestructionTest() {}
+ ~ScreenDimmerShellDestructionTest() override {}
+
+ void TearDown() override {
+ ScreenDimmer screen_dimmer(ScreenDimmer::Container::ROOT);
+ AshTestBase::TearDown();
+ // ScreenDimmer is destroyed *after* the shell.
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScreenDimmerShellDestructionTest);
+};
+
+// This test verifies ScreenDimmer can be destroyed after the shell. The
+// interesting part of this test is in TearDown(), which creates a ScreenDimmer
+// that is deleted after WmShell.
+TEST_F(ScreenDimmerShellDestructionTest, DontCrashIfScreenDimmerOutlivesShell) {
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/common/wm/screen_dimmer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698