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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ash/common/wm/screen_dimmer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/wm/screen_dimmer.h" 5 #include "ash/common/wm/screen_dimmer.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/wm/window_dimmer.h" 10 #include "ash/common/wm/window_dimmer.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 dimmer_->set_at_bottom(true); 113 dimmer_->set_at_bottom(true);
114 dimmer_->SetDimming(true); 114 dimmer_->SetDimming(true);
115 115
116 dim_iter = std::find(root_window->children().begin(), 116 dim_iter = std::find(root_window->children().begin(),
117 root_window->children().end(), GetDimWindow()); 117 root_window->children().end(), GetDimWindow());
118 ASSERT_TRUE(dim_iter != root_window->children().end()); 118 ASSERT_TRUE(dim_iter != root_window->children().end());
119 // Dom layer is at the bottom. 119 // Dom layer is at the bottom.
120 EXPECT_EQ(*dim_iter, *root_window->children().begin()); 120 EXPECT_EQ(*dim_iter, *root_window->children().begin());
121 } 121 }
122 122
123 // See description above TEST_F for details.
124 class ScreenDimmerShellDestructionTest : public AshTestBase {
125 public:
126 ScreenDimmerShellDestructionTest() {}
127 ~ScreenDimmerShellDestructionTest() override {}
128
129 void TearDown() override {
130 ScreenDimmer screen_dimmer(ScreenDimmer::Container::ROOT);
131 AshTestBase::TearDown();
132 // ScreenDimmer is destroyed *after* the shell.
133 }
134
135 private:
136 DISALLOW_COPY_AND_ASSIGN(ScreenDimmerShellDestructionTest);
137 };
138
139 // This test verifies ScreenDimmer can be destroyed after the shell. The
140 // interesting part of this test is in TearDown(), which creates a ScreenDimmer
141 // that is deleted after WmShell.
142 TEST_F(ScreenDimmerShellDestructionTest, DontCrashIfScreenDimmerOutlivesShell) {
143 }
144
123 } // namespace test 145 } // namespace test
124 } // namespace ash 146 } // namespace ash
OLDNEW
« 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