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 "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 aura::RootWindow::DeleteInstance(); | 146 aura::RootWindow::DeleteInstance(); |
147 EXPECT_FALSE(widget->did_size_change_more_than_once()); | 147 EXPECT_FALSE(widget->did_size_change_more_than_once()); |
148 widget->CloseNow(); | 148 widget->CloseNow(); |
149 } | 149 } |
150 | 150 |
151 TEST_F(NativeWidgetAuraTest, GetClientAreaScreenBounds) { | 151 TEST_F(NativeWidgetAuraTest, GetClientAreaScreenBounds) { |
152 // Create a widget. | 152 // Create a widget. |
153 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); | 153 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); |
154 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 154 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
155 params.bounds.SetRect(10, 20, 300, 400); | 155 params.bounds.SetRect(10, 20, 300, 400); |
156 Widget* widget = new Widget(); | 156 scoped_ptr<Widget> widget(new Widget()); |
157 widget->Init(params); | 157 widget->Init(params); |
158 | 158 |
159 // For Aura, client area bounds match window bounds. | 159 // For Aura, client area bounds match window bounds. |
160 gfx::Rect client_bounds = widget->GetClientAreaScreenBounds(); | 160 gfx::Rect client_bounds = widget->GetClientAreaScreenBounds(); |
161 EXPECT_EQ(10, client_bounds.x()); | 161 EXPECT_EQ(10, client_bounds.x()); |
162 EXPECT_EQ(20, client_bounds.y()); | 162 EXPECT_EQ(20, client_bounds.y()); |
163 EXPECT_EQ(300, client_bounds.width()); | 163 EXPECT_EQ(300, client_bounds.width()); |
164 EXPECT_EQ(400, client_bounds.height()); | 164 EXPECT_EQ(400, client_bounds.height()); |
165 } | 165 } |
166 | 166 |
167 } // namespace | 167 } // namespace |
168 } // namespace views | 168 } // namespace views |
OLD | NEW |