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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc

Issue 2747723004: Revert of Correctly update the popup window position (patchset #6 id:160001 of https://codereview.c… (Closed)
Patch Set: Created 3 years, 9 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/aura/window.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_position_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/desktop_aura/desktop_native_widget_aura.h" 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 ui::EF_NONE, ui::EF_NONE); 607 ui::EF_NONE, ui::EF_NONE);
608 details = GetEventProcessor(&top_level_widget)->OnEventFromSource( 608 details = GetEventProcessor(&top_level_widget)->OnEventFromSource(
609 &mouse_down_main); 609 &mouse_down_main);
610 ASSERT_FALSE(details.dispatcher_destroyed); 610 ASSERT_FALSE(details.dispatcher_destroyed);
611 EXPECT_EQ(0, widget_view->GetEventCount(ui::ET_MOUSE_MOVED)); 611 EXPECT_EQ(0, widget_view->GetEventCount(ui::ET_MOUSE_MOVED));
612 612
613 modal_dialog_widget->CloseNow(); 613 modal_dialog_widget->CloseNow();
614 top_level_widget.CloseNow(); 614 top_level_widget.CloseNow();
615 } 615 }
616 616
617 TEST_F(WidgetTest, SetScreenBoundsOnNativeWindow) {
618 Widget widget;
619 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
620 params.native_widget =
621 CreatePlatformDesktopNativeWidgetImpl(params, &widget, nullptr);
622 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
623 params.bounds = gfx::Rect(10, 10, 100, 100);
624 widget.Init(params);
625 widget.Show();
626 aura::Window* window = widget.GetNativeWindow();
627 display::Screen* screen = display::Screen::GetScreen();
628
629 const gfx::Rect new_screen_bounds(50, 50, 150, 150);
630 window->SetBoundsInScreen(new_screen_bounds,
631 screen->GetPrimaryDisplay());
632 EXPECT_EQ(new_screen_bounds, widget.GetWindowBoundsInScreen());
633 widget.CloseNow();
634 }
635
636 #if defined(OS_WIN) 617 #if defined(OS_WIN)
637 // Tests whether we can activate the top level widget when a modal dialog is 618 // Tests whether we can activate the top level widget when a modal dialog is
638 // active. 619 // active.
639 // Flaky: crbug.com/613428 620 // Flaky: crbug.com/613428
640 TEST_F(WidgetTest, DISABLED_WindowModalityActivationTest) { 621 TEST_F(WidgetTest, DISABLED_WindowModalityActivationTest) {
641 TestDesktopWidgetDelegate widget_delegate; 622 TestDesktopWidgetDelegate widget_delegate;
642 widget_delegate.InitWidget(CreateParams(Widget::InitParams::TYPE_WINDOW)); 623 widget_delegate.InitWidget(CreateParams(Widget::InitParams::TYPE_WINDOW));
643 624
644 Widget* top_level_widget = widget_delegate.GetWidget(); 625 Widget* top_level_widget = widget_delegate.GetWidget();
645 top_level_widget->Show(); 626 top_level_widget->Show();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); 674 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled);
694 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); 675 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled);
695 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); 676 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled);
696 widget.CloseNow(); 677 widget.CloseNow();
697 } 678 }
698 679
699 #endif // defined(OS_WIN) 680 #endif // defined(OS_WIN)
700 681
701 } // namespace test 682 } // namespace test
702 } // namespace views 683 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_position_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698