Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 127453002: Enable the DesktopAuraTopLevelOwnedPopupResizeTest test for Linux AURA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698