OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/header_painter.h" | 5 #include "ash/wm/header_painter.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/root_window_settings.h" | 8 #include "ash/root_window_settings.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 params.delegate = new ResizableWidgetDelegate(widget); | 201 params.delegate = new ResizableWidgetDelegate(widget); |
202 params.type = Widget::InitParams::TYPE_WINDOW; | 202 params.type = Widget::InitParams::TYPE_WINDOW; |
203 widget->Init(params); | 203 widget->Init(params); |
204 return widget; | 204 return widget; |
205 } | 205 } |
206 }; | 206 }; |
207 | 207 |
208 TEST_F(HeaderPainterTest, CreateAndDeleteSingleWindow) { | 208 TEST_F(HeaderPainterTest, CreateAndDeleteSingleWindow) { |
209 // Ensure that creating/deleting a window works well and doesn't cause | 209 // Ensure that creating/deleting a window works well and doesn't cause |
210 // crashes. See crbug.com/155634 | 210 // crashes. See crbug.com/155634 |
211 aura::RootWindow* root = Shell::GetTargetRootWindow(); | 211 aura::Window* root = Shell::GetTargetRootWindow(); |
212 | 212 |
213 scoped_ptr<Widget> widget(CreateTestWidget()); | 213 scoped_ptr<Widget> widget(CreateTestWidget()); |
214 scoped_ptr<HeaderPainter> painter(CreateTestPainter(widget.get())); | 214 scoped_ptr<HeaderPainter> painter(CreateTestPainter(widget.get())); |
215 widget->Show(); | 215 widget->Show(); |
216 | 216 |
217 // We only have one window, so it should use a solo header. | 217 // We only have one window, so it should use a solo header. |
218 EXPECT_TRUE(painter->UseSoloWindowHeader()); | 218 EXPECT_TRUE(painter->UseSoloWindowHeader()); |
219 EXPECT_TRUE(internal::GetRootWindowSettings(root)->solo_window_header); | 219 EXPECT_TRUE(internal::GetRootWindowSettings(root)->solo_window_header); |
220 | 220 |
221 // Close the window. | 221 // Close the window. |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 HeaderPainterOwner* o2 = new HeaderPainterOwner(w2); | 657 HeaderPainterOwner* o2 = new HeaderPainterOwner(w2); |
658 HeaderPainter* p2 = o2->header_painter(); | 658 HeaderPainter* p2 = o2->header_painter(); |
659 w2->Show(); | 659 w2->Show(); |
660 EXPECT_FALSE(p1->UseSoloWindowHeader()); | 660 EXPECT_FALSE(p1->UseSoloWindowHeader()); |
661 EXPECT_FALSE(p2->UseSoloWindowHeader()); | 661 EXPECT_FALSE(p2->UseSoloWindowHeader()); |
662 | 662 |
663 // Exit with no resource release. They'll be released at shutdown. | 663 // Exit with no resource release. They'll be released at shutdown. |
664 } | 664 } |
665 | 665 |
666 } // namespace ash | 666 } // namespace ash |
OLD | NEW |