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

Side by Side Diff: components/constrained_window/constrained_window_views_unittest.cc

Issue 1921973002: Convert //components/[a-e]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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
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 "components/constrained_window/constrained_window_views.h" 5 #include "components/constrained_window/constrained_window_views.h"
6 6
7 #include <memory>
8
7 #include "base/macros.h" 9 #include "base/macros.h"
8 #include "components/web_modal/test_web_contents_modal_dialog_host.h" 10 #include "components/web_modal/test_web_contents_modal_dialog_host.h"
9 #include "ui/gfx/geometry/point.h" 11 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
13 #include "ui/views/border.h" 15 #include "ui/views/border.h"
14 #include "ui/views/test/views_test_base.h" 16 #include "ui/views/test/views_test_base.h"
15 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
16 #include "ui/views/window/dialog_delegate.h" 18 #include "ui/views/window/dialog_delegate.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 75 }
74 76
75 DialogContents* contents() { return contents_; } 77 DialogContents* contents() { return contents_; }
76 web_modal::TestWebContentsModalDialogHost* dialog_host() { 78 web_modal::TestWebContentsModalDialogHost* dialog_host() {
77 return dialog_host_.get(); 79 return dialog_host_.get();
78 } 80 }
79 Widget* dialog() { return dialog_; } 81 Widget* dialog() { return dialog_; }
80 82
81 private: 83 private:
82 DialogContents* contents_; 84 DialogContents* contents_;
83 scoped_ptr<web_modal::TestWebContentsModalDialogHost> dialog_host_; 85 std::unique_ptr<web_modal::TestWebContentsModalDialogHost> dialog_host_;
84 Widget* dialog_; 86 Widget* dialog_;
85 87
86 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViewsTest); 88 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViewsTest);
87 }; 89 };
88 90
89 } // namespace 91 } // namespace
90 92
91 // Make sure a dialog that increases its preferred size grows on the next 93 // Make sure a dialog that increases its preferred size grows on the next
92 // position update. 94 // position update.
93 TEST_F(ConstrainedWindowViewsTest, GrowModalDialogSize) { 95 TEST_F(ConstrainedWindowViewsTest, GrowModalDialogSize) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 148
147 // Increasing the maximum dialog size should bring the dialog back to its 149 // Increasing the maximum dialog size should bring the dialog back to its
148 // original size. 150 // original size.
149 max_dialog_size.Enlarge(100, 100); 151 max_dialog_size.Enlarge(100, 100);
150 dialog_host()->set_max_dialog_size(max_dialog_size); 152 dialog_host()->set_max_dialog_size(max_dialog_size);
151 UpdateWebContentsModalDialogPosition(dialog(), dialog_host()); 153 UpdateWebContentsModalDialogPosition(dialog(), dialog_host());
152 EXPECT_EQ(full_dialog_size.ToString(), GetDialogSize().ToString()); 154 EXPECT_EQ(full_dialog_size.ToString(), GetDialogSize().ToString());
153 } 155 }
154 156
155 } // namespace constrained_window 157 } // namespace constrained_window
OLDNEW
« no previous file with comments | « components/constrained_window/constrained_window_views.cc ('k') | components/crx_file/crx_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698