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

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

Issue 13849012: We need to call aura::Window::Show from the DesktopNativeWidgetAura::ShowMaximizedWithBounds and Sh… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/base/events/event_utils.h" 10 #include "ui/base/events/event_utils.h"
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 1437
1438 DesktopAuraFullscreenChildWindowDestructionTest full_screen_child_test; 1438 DesktopAuraFullscreenChildWindowDestructionTest full_screen_child_test;
1439 ASSERT_NO_FATAL_FAILURE(full_screen_child_test.CreateFullscreenChildWindow( 1439 ASSERT_NO_FATAL_FAILURE(full_screen_child_test.CreateFullscreenChildWindow(
1440 gfx::Rect(0, 0, 200, 200))); 1440 gfx::Rect(0, 0, 200, 200)));
1441 1441
1442 RunPendingMessages(); 1442 RunPendingMessages();
1443 ASSERT_NO_FATAL_FAILURE(full_screen_child_test.DestroyParentWindow()); 1443 ASSERT_NO_FATAL_FAILURE(full_screen_child_test.DestroyParentWindow());
1444 RunPendingMessages(); 1444 RunPendingMessages();
1445 } 1445 }
1446 1446
1447 // Test to ensure that the aura Window's visiblity state is set to visible if
1448 // the underlying widget is hidden and then shown.
1449 TEST_F(WidgetTest, TestWindowVisibilityAfterHide) {
1450 // Create a widget.
1451 Widget widget;
1452 Widget::InitParams init_params =
1453 CreateParams(Widget::InitParams::TYPE_WINDOW);
1454 init_params.show_state = ui::SHOW_STATE_NORMAL;
1455 gfx::Rect initial_bounds(0, 0, 300, 400);
1456 init_params.bounds = initial_bounds;
1457 init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
1458 init_params.native_widget = new DesktopNativeWidgetAura(&widget);
1459 widget.Init(init_params);
1460 NonClientView* non_client_view = widget.non_client_view();
1461 NonClientFrameView* frame_view = new MinimumSizeFrameView(&widget);
1462 non_client_view->SetFrameView(frame_view);
1463
1464 widget.Hide();
1465 EXPECT_FALSE(widget.GetNativeView()->IsVisible());
1466 widget.Show();
1467 EXPECT_TRUE(widget.GetNativeView()->IsVisible());
1468 }
1469
1447 #endif // !defined(OS_CHROMEOS) 1470 #endif // !defined(OS_CHROMEOS)
1448 1471
1449 // Tests that wheel events generted from scroll events are targetted to the 1472 // Tests that wheel events generted from scroll events are targetted to the
1450 // views under the cursor when the focused view does not processed them. 1473 // views under the cursor when the focused view does not processed them.
1451 TEST_F(WidgetTest, WheelEventsFromScrollEventTarget) { 1474 TEST_F(WidgetTest, WheelEventsFromScrollEventTarget) {
1452 EventCountView* focused_view = new EventCountView; 1475 EventCountView* focused_view = new EventCountView;
1453 focused_view->set_focusable(true); 1476 focused_view->set_focusable(true);
1454 1477
1455 EventCountView* cursor_view = new EventCountView; 1478 EventCountView* cursor_view = new EventCountView;
1456 1479
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 gfx::Point click_location(45, 15); 1768 gfx::Point click_location(45, 15);
1746 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, click_location, click_location, 1769 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, click_location, click_location,
1747 ui::EF_LEFT_MOUSE_BUTTON); 1770 ui::EF_LEFT_MOUSE_BUTTON);
1748 widget->OnMouseEvent(&press); 1771 widget->OnMouseEvent(&press);
1749 1772
1750 // Yay we did not crash! 1773 // Yay we did not crash!
1751 } 1774 }
1752 1775
1753 } // namespace 1776 } // namespace
1754 } // namespace views 1777 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698