Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } | |
|
James Cook
2016/09/20 23:26:18
I would add a comment above this line pointing out
sky
2016/09/20 23:33:19
Done.
| |
| 133 | |
| 134 private: | |
| 135 DISALLOW_COPY_AND_ASSIGN(ScreenDimmerShellDestructionTest); | |
| 136 }; | |
| 137 | |
| 138 // This test verifies ScreenDimmer can be destroyed after the shell. The | |
| 139 // interesting part of this test is in TearDown(), which creates a ScreenDimmer | |
| 140 // that is deleted after WmShell. | |
| 141 TEST_F(ScreenDimmerShellDestructionTest, DontCrashIfScreenDimmerOutlivesShell) { | |
| 142 } | |
| 143 | |
| 123 } // namespace test | 144 } // namespace test |
| 124 } // namespace ash | 145 } // namespace ash |
| OLD | NEW |