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

Unified Diff: ui/views/bubble/bubble_dialog_delegate_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.cc ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_dialog_delegate_unittest.cc
diff --git a/ui/views/bubble/bubble_dialog_delegate_unittest.cc b/ui/views/bubble/bubble_dialog_delegate_unittest.cc
index 6c43388c9444573a328a3ef49e7f0cd77db84762..806a4ef02f5c136904b6510aebacd27a4e157ebc 100644
--- a/ui/views/bubble/bubble_dialog_delegate_unittest.cc
+++ b/ui/views/bubble/bubble_dialog_delegate_unittest.cc
@@ -64,7 +64,7 @@ class BubbleDialogDelegateTest : public ViewsTestBase {
} // namespace
TEST_F(BubbleDialogDelegateTest, CreateDelegate) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
TestBubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
bubble_delegate->set_color(SK_ColorGREEN);
@@ -85,7 +85,7 @@ TEST_F(BubbleDialogDelegateTest, CreateDelegate) {
}
TEST_F(BubbleDialogDelegateTest, CloseAnchorWidget) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
// Preventing close on deactivate should not prevent closing with the anchor.
@@ -104,7 +104,7 @@ TEST_F(BubbleDialogDelegateTest, CloseAnchorWidget) {
// TODO(msw): Remove activation hack to prevent bookkeeping errors in:
// aura::test::TestActivationClient::OnWindowDestroyed().
- scoped_ptr<Widget> smoke_and_mirrors_widget(CreateTestWidget());
+ std::unique_ptr<Widget> smoke_and_mirrors_widget(CreateTestWidget());
EXPECT_FALSE(bubble_observer.widget_closed());
// Ensure that closing the anchor widget also closes the bubble itself.
@@ -117,8 +117,8 @@ TEST_F(BubbleDialogDelegateTest, CloseAnchorWidget) {
// bubble will call upon the anchor view to get its location).
TEST_F(BubbleDialogDelegateTest, CloseAnchorViewTest) {
// Create an anchor widget and add a view to be used as an anchor view.
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
- scoped_ptr<View> anchor_view(new View());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<View> anchor_view(new View());
anchor_widget->GetContentsView()->AddChildView(anchor_view.get());
TestBubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_view.get());
@@ -151,7 +151,7 @@ TEST_F(BubbleDialogDelegateTest, CloseAnchorViewTest) {
// Testing that a move of the anchor view will lead to new bubble locations.
TEST_F(BubbleDialogDelegateTest, TestAnchorRectMovesWithViewTest) {
// Create an anchor widget and add a view to be used as anchor view.
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
TestBubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
BubbleDialogDelegateView::CreateBubble(bubble_delegate);
@@ -165,13 +165,13 @@ TEST_F(BubbleDialogDelegateTest, TestAnchorRectMovesWithViewTest) {
}
TEST_F(BubbleDialogDelegateTest, ResetAnchorWidget) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
// Make sure the bubble widget is parented to a widget other than the anchor
// widget so that closing the anchor widget does not close the bubble widget.
- scoped_ptr<Widget> parent_widget(CreateTestWidget());
+ std::unique_ptr<Widget> parent_widget(CreateTestWidget());
bubble_delegate->set_parent_window(parent_widget->GetNativeView());
// Preventing close on deactivate should not prevent closing with the parent.
bubble_delegate->set_close_on_deactivate(false);
@@ -197,7 +197,7 @@ TEST_F(BubbleDialogDelegateTest, ResetAnchorWidget) {
// TODO(msw): Remove activation hack to prevent bookkeeping errors in:
// aura::test::TestActivationClient::OnWindowDestroyed().
- scoped_ptr<Widget> smoke_and_mirrors_widget(CreateTestWidget());
+ std::unique_ptr<Widget> smoke_and_mirrors_widget(CreateTestWidget());
EXPECT_FALSE(bubble_observer.widget_closed());
// Ensure that closing the parent widget also closes the bubble itself.
@@ -206,7 +206,7 @@ TEST_F(BubbleDialogDelegateTest, ResetAnchorWidget) {
}
TEST_F(BubbleDialogDelegateTest, InitiallyFocusedView) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
Widget* bubble_widget =
@@ -218,7 +218,7 @@ TEST_F(BubbleDialogDelegateTest, InitiallyFocusedView) {
}
TEST_F(BubbleDialogDelegateTest, NonClientHitTest) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
TestBubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
BubbleDialogDelegateView::CreateBubble(bubble_delegate);
@@ -240,7 +240,7 @@ TEST_F(BubbleDialogDelegateTest, NonClientHitTest) {
}
TEST_F(BubbleDialogDelegateTest, VisibleWhenAnchorWidgetBoundsChanged) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
Widget* bubble_widget =
@@ -258,7 +258,7 @@ TEST_F(BubbleDialogDelegateTest, VisibleWhenAnchorWidgetBoundsChanged) {
// Test that setting WidgetDelegate::set_can_activate() to false makes the
// widget created via BubbleDialogDelegateView::CreateBubble() not activatable.
TEST_F(BubbleDialogDelegateTest, NotActivatable) {
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
bubble_delegate->set_can_activate(false);
@@ -270,7 +270,7 @@ TEST_F(BubbleDialogDelegateTest, NotActivatable) {
TEST_F(BubbleDialogDelegateTest, CloseMethods) {
{
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
bubble_delegate->set_close_on_deactivate(true);
@@ -283,7 +283,7 @@ TEST_F(BubbleDialogDelegateTest, CloseMethods) {
}
{
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
BubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
Widget* bubble_widget =
@@ -296,7 +296,7 @@ TEST_F(BubbleDialogDelegateTest, CloseMethods) {
}
{
- scoped_ptr<Widget> anchor_widget(CreateTestWidget());
+ std::unique_ptr<Widget> anchor_widget(CreateTestWidget());
TestBubbleDialogDelegateView* bubble_delegate =
new TestBubbleDialogDelegateView(anchor_widget->GetContentsView());
Widget* bubble_widget =
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.cc ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698