| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 ViewsDelegate::views_delegate = NULL; | 1211 ViewsDelegate::views_delegate = NULL; |
| 1212 DesktopAuraTopLevelWindowTest popup_window; | 1212 DesktopAuraTopLevelWindowTest popup_window; |
| 1213 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( | 1213 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( |
| 1214 gfx::Rect(0, 0, 200, 200), false)); | 1214 gfx::Rect(0, 0, 200, 200), false)); |
| 1215 | 1215 |
| 1216 RunPendingMessages(); | 1216 RunPendingMessages(); |
| 1217 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); | 1217 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); |
| 1218 RunPendingMessages(); | 1218 RunPendingMessages(); |
| 1219 } | 1219 } |
| 1220 | 1220 |
| 1221 #if defined(OS_WIN) | |
| 1222 // TODO(ananta) | |
| 1223 // Fix this test to work on Linux Aura. Need to implement the | |
| 1224 // views::DesktopWindowTreeHostX11::SetSize function | |
| 1225 // This test validates that when a top level owned popup Aura window is | 1221 // This test validates that when a top level owned popup Aura window is |
| 1226 // resized, the widget is resized as well. | 1222 // resized, the widget is resized as well. |
| 1227 TEST_F(WidgetTest, DesktopAuraTopLevelOwnedPopupResizeTest) { | 1223 TEST_F(WidgetTest, DesktopAuraTopLevelOwnedPopupResizeTest) { |
| 1228 ViewsDelegate::views_delegate = NULL; | 1224 ViewsDelegate::views_delegate = NULL; |
| 1229 DesktopAuraTopLevelWindowTest popup_window; | 1225 DesktopAuraTopLevelWindowTest popup_window; |
| 1230 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( | 1226 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( |
| 1231 gfx::Rect(0, 0, 200, 200), false)); | 1227 gfx::Rect(0, 0, 200, 200), false)); |
| 1232 | 1228 |
| 1233 gfx::Rect new_size(0, 0, 400, 400); | 1229 gfx::Rect new_size(0, 0, 400, 400); |
| 1234 popup_window.owned_window()->SetBounds(new_size); | 1230 popup_window.owned_window()->SetBounds(new_size); |
| 1235 | 1231 |
| 1236 EXPECT_EQ(popup_window.top_level_widget()->GetNativeView()->bounds().size(), | 1232 EXPECT_EQ(popup_window.top_level_widget()->GetNativeView()->bounds().size(), |
| 1237 new_size.size()); | 1233 new_size.size()); |
| 1238 RunPendingMessages(); | 1234 RunPendingMessages(); |
| 1239 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); | 1235 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); |
| 1240 RunPendingMessages(); | 1236 RunPendingMessages(); |
| 1241 } | 1237 } |
| 1242 #endif | |
| 1243 | 1238 |
| 1244 // Test to ensure that the aura Window's visiblity state is set to visible if | 1239 // Test to ensure that the aura Window's visiblity state is set to visible if |
| 1245 // the underlying widget is hidden and then shown. | 1240 // the underlying widget is hidden and then shown. |
| 1246 TEST_F(WidgetTest, TestWindowVisibilityAfterHide) { | 1241 TEST_F(WidgetTest, TestWindowVisibilityAfterHide) { |
| 1247 // Create a widget. | 1242 // Create a widget. |
| 1248 Widget widget; | 1243 Widget widget; |
| 1249 Widget::InitParams init_params = | 1244 Widget::InitParams init_params = |
| 1250 CreateParams(Widget::InitParams::TYPE_WINDOW); | 1245 CreateParams(Widget::InitParams::TYPE_WINDOW); |
| 1251 init_params.show_state = ui::SHOW_STATE_NORMAL; | 1246 init_params.show_state = ui::SHOW_STATE_NORMAL; |
| 1252 gfx::Rect initial_bounds(0, 0, 300, 400); | 1247 gfx::Rect initial_bounds(0, 0, 300, 400); |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 | 2288 |
| 2294 widget->ShowInactive(); | 2289 widget->ShowInactive(); |
| 2295 widget->Show(); | 2290 widget->Show(); |
| 2296 EXPECT_EQ(GetWidgetShowState(widget), ui::SHOW_STATE_NORMAL); | 2291 EXPECT_EQ(GetWidgetShowState(widget), ui::SHOW_STATE_NORMAL); |
| 2297 | 2292 |
| 2298 widget->CloseNow(); | 2293 widget->CloseNow(); |
| 2299 } | 2294 } |
| 2300 | 2295 |
| 2301 } // namespace test | 2296 } // namespace test |
| 2302 } // namespace views | 2297 } // namespace views |
| OLD | NEW |