OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/custom_frame_view_ash.h" | 5 #include "ash/wm/custom_frame_view_ash.h" |
6 | 6 |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "grit/ash_resources.h" | 9 #include "grit/ash_resources.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 views::Widget::InitParams params; | 54 views::Widget::InitParams params; |
55 params.delegate = delegate; | 55 params.delegate = delegate; |
56 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 56 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
57 params.bounds = gfx::Rect(0, 0, 100, 100); | 57 params.bounds = gfx::Rect(0, 0, 100, 100); |
58 params.context = CurrentContext(); | 58 params.context = CurrentContext(); |
59 widget->Init(params); | 59 widget->Init(params); |
60 widget->Show(); | 60 widget->Show(); |
61 | 61 |
62 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 62 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
63 gfx::ImageSkia* close_button = | 63 gfx::ImageSkia* close_button = |
64 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_MAXIMIZED_CLOSE); | 64 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_CONTROL_BACKGROUND_H); |
65 | 65 |
66 // |kSeparatorSize| should match |kHeaderContentSeparatorSize| in | 66 // |kSeparatorSize| should match |kHeaderContentSeparatorSize| in |
67 // header_painter.cc | 67 // header_painter.cc |
68 // TODO(pkotwicz): Clean this test up once the separator overlays the window | 68 // TODO(pkotwicz): Clean this test up once the separator overlays the window |
69 // controls. | 69 // controls. |
70 const int kSeparatorSize = 1; | 70 const int kSeparatorSize = 1; |
71 | 71 |
72 // The header should have enough room for the window controls and the | 72 // The header should have enough room for the window controls and the |
73 // separator line. | 73 // separator line. |
74 EXPECT_EQ(close_button->height() + kSeparatorSize, | 74 EXPECT_EQ(close_button->height() + kSeparatorSize, |
75 delegate->custom_frame_view()->GetHeaderView()->height()); | 75 delegate->custom_frame_view()->GetHeaderView()->height()); |
76 | 76 |
77 widget->Maximize(); | 77 widget->Maximize(); |
78 close_button = rb.GetImageSkiaNamed(IDR_AURA_WINDOW_MAXIMIZED_CLOSE2); | |
79 EXPECT_EQ(close_button->height() + kSeparatorSize, | 78 EXPECT_EQ(close_button->height() + kSeparatorSize, |
80 delegate->custom_frame_view()->GetHeaderView()->height()); | 79 delegate->custom_frame_view()->GetHeaderView()->height()); |
81 } | 80 } |
82 | 81 |
83 } // namespace ash | 82 } // namespace ash |
OLD | NEW |