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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #import "chrome/browser/ui/cocoa/autofill/layout_view.h" 5 #import "chrome/browser/ui/cocoa/autofill/layout_view.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" 8 #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
11 #import "ui/gfx/test/ui_cocoa_test_helper.h" 11 #import "ui/gfx/test/ui_cocoa_test_helper.h"
12 12
13 namespace { 13 namespace {
14 14
15 class LayoutViewTest : public ui::CocoaTest { 15 class LayoutViewTest : public ui::CocoaTest {
16 public: 16 public:
17 LayoutViewTest() { 17 LayoutViewTest() {
18 CocoaTest::SetUp(); 18 CocoaTest::SetUp();
19 view_.reset([[LayoutView alloc] initWithFrame:NSZeroRect]); 19 view_.reset([[LayoutView alloc] initWithFrame:NSZeroRect]);
20 [view_ setLayoutManager: 20 [view_ setLayoutManager:std::unique_ptr<SimpleGridLayout>(
21 scoped_ptr<SimpleGridLayout>(new SimpleGridLayout(view_))]; 21 new SimpleGridLayout(view_))];
22 layout_ = [view_ layoutManager]; 22 layout_ = [view_ layoutManager];
23 [[test_window() contentView] addSubview:view_]; 23 [[test_window() contentView] addSubview:view_];
24 } 24 }
25 25
26 protected: 26 protected:
27 base::scoped_nsobject<LayoutView> view_; 27 base::scoped_nsobject<LayoutView> view_;
28 SimpleGridLayout* layout_; // weak, owned by view_. 28 SimpleGridLayout* layout_; // weak, owned by view_.
29 }; 29 };
30 30
31 } // namespace 31 } // namespace
(...skipping 24 matching lines...) Expand all
56 EXPECT_FLOAT_EQ(60, NSHeight([view_ frame])); 56 EXPECT_FLOAT_EQ(60, NSHeight([view_ frame]));
57 57
58 NSView* subview = [[view_ subviews] objectAtIndex:0]; 58 NSView* subview = [[view_ subviews] objectAtIndex:0];
59 EXPECT_FLOAT_EQ(16, NSWidth([subview frame])); 59 EXPECT_FLOAT_EQ(16, NSWidth([subview frame]));
60 EXPECT_FLOAT_EQ(55, NSHeight([subview frame])); 60 EXPECT_FLOAT_EQ(55, NSHeight([subview frame]));
61 61
62 subview = [[view_ subviews] objectAtIndex:1]; 62 subview = [[view_ subviews] objectAtIndex:1];
63 EXPECT_FLOAT_EQ(24, NSWidth([subview frame])); 63 EXPECT_FLOAT_EQ(24, NSWidth([subview frame]));
64 EXPECT_FLOAT_EQ(55, NSHeight([subview frame])); 64 EXPECT_FLOAT_EQ(55, NSHeight([subview frame]));
65 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698