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

Side by Side Diff: ui/views/layout/box_layout_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 unified diff | Download patch
« no previous file with comments | « ui/views/focus/focus_manager_unittest.cc ('k') | ui/views/linux_ui/linux_ui.h » ('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 (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 "ui/views/layout/box_layout.h" 5 #include "ui/views/layout/box_layout.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/views/test/test_views.h" 10 #include "ui/views/test/test_views.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 namespace { 15 namespace {
16 16
17 class BoxLayoutTest : public testing::Test { 17 class BoxLayoutTest : public testing::Test {
18 public: 18 public:
19 void SetUp() override { host_.reset(new View); } 19 void SetUp() override { host_.reset(new View); }
20 20
21 scoped_ptr<View> host_; 21 std::unique_ptr<View> host_;
22 }; 22 };
23 23
24 } // namespace 24 } // namespace
25 25
26 TEST_F(BoxLayoutTest, Empty) { 26 TEST_F(BoxLayoutTest, Empty) {
27 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 20); 27 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 20);
28 host_->SetLayoutManager(layout); 28 host_->SetLayoutManager(layout);
29 EXPECT_EQ(gfx::Size(20, 20), layout->GetPreferredSize(host_.get())); 29 EXPECT_EQ(gfx::Size(20, 20), layout->GetPreferredSize(host_.get()));
30 } 30 }
31 31
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0); 623 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
624 host_->SetLayoutManager(layout); 624 host_->SetLayoutManager(layout);
625 View* v1 = new StaticSizedView(gfx::Size(20, 10)); 625 View* v1 = new StaticSizedView(gfx::Size(20, 10));
626 host_->AddChildView(v1); 626 host_->AddChildView(v1);
627 layout->set_minimum_cross_axis_size(30); 627 layout->set_minimum_cross_axis_size(30);
628 628
629 EXPECT_EQ(gfx::Size(20, 30), layout->GetPreferredSize(host_.get())); 629 EXPECT_EQ(gfx::Size(20, 30), layout->GetPreferredSize(host_.get()));
630 } 630 }
631 631
632 } // namespace views 632 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/focus/focus_manager_unittest.cc ('k') | ui/views/linux_ui/linux_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698