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

Unified Diff: ui/views/window/dialog_client_view_unittest.cc

Issue 1645013004: Views - dialog button defaultness shouldn't follow focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win compile Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view_unittest.cc
diff --git a/ui/views/window/dialog_client_view_unittest.cc b/ui/views/window/dialog_client_view_unittest.cc
index 2a08f3e684f3e3e57b633b84bdaaf65cb41a7bb4..b264793d232c29dd3956877aedaca37263c320d1 100644
--- a/ui/views/window/dialog_client_view_unittest.cc
+++ b/ui/views/window/dialog_client_view_unittest.cc
@@ -256,64 +256,4 @@ TEST_F(DialogClientViewTest, LayoutWithFootnoteHeightForWidth) {
footnote_view->bounds().height());
}
-// No ReparentNativeView on Mac. See http://crbug.com/514920.
-#if defined(OS_MACOSX) && !defined(USE_AURA)
-#define MAYBE_FocusManager DISABLED_FocusManager
-#else
-#define MAYBE_FocusManager FocusManager
-#endif
-
-// Test that the DialogClientView's FocusManager is properly updated when the
-// DialogClientView belongs to a non top level widget and the widget is
-// reparented. The DialogClientView belongs to a non top level widget in the
-// case of constrained windows. The constrained window's widget is reparented
-// when a browser tab is dragged to a different browser window.
-TEST_F(DialogClientViewTest, MAYBE_FocusManager) {
- scoped_ptr<Widget> toplevel1(new Widget);
- Widget::InitParams toplevel1_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW);
- toplevel1_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- toplevel1->Init(toplevel1_params);
-
- scoped_ptr<Widget> toplevel2(new Widget);
- Widget::InitParams toplevel2_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW);
- toplevel2_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- toplevel2->Init(toplevel2_params);
-
- Widget* dialog = new Widget;
- Widget::InitParams dialog_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW);
- dialog_params.child = true;
- dialog_params.delegate = new DialogDelegateView();
- dialog_params.parent = toplevel1->GetNativeView();
- dialog->Init(dialog_params);
-
- // Test that the FocusManager has been properly set when the DialogClientView
- // was parented to |dialog|.
- DialogClientView* client_view =
- static_cast<DialogClientView*>(dialog->client_view());
- EXPECT_EQ(toplevel1->GetFocusManager(), client_view->focus_manager_);
-
- // Test that the FocusManager is properly updated when the DialogClientView's
- // top level widget is changed.
- Widget::ReparentNativeView(dialog->GetNativeView(), NULL);
- EXPECT_EQ(NULL, client_view->focus_manager_);
- Widget::ReparentNativeView(dialog->GetNativeView(),
- toplevel2->GetNativeView());
- EXPECT_EQ(toplevel2->GetFocusManager(), client_view->focus_manager_);
- Widget::ReparentNativeView(dialog->GetNativeView(),
- toplevel1->GetNativeView());
- EXPECT_NE(toplevel1->GetFocusManager(), toplevel2->GetFocusManager());
- EXPECT_EQ(toplevel1->GetFocusManager(), client_view->focus_manager_);
-
- // Test that the FocusManager is properly cleared when the DialogClientView is
- // removed from |dialog| during the widget's destruction.
- client_view->set_owned_by_client();
- scoped_ptr<DialogClientView> owned_client_view(client_view);
- toplevel1->CloseNow();
- toplevel2->CloseNow();
- EXPECT_EQ(NULL, owned_client_view->focus_manager_);
-}
-
} // namespace views
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698