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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/infobars/confirm_infobar_controller.h" 5 #import "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
6 6
7 #include <utility>
8
7 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
9 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/infobars/infobar_service.h" 12 #include "chrome/browser/infobars/infobar_service.h"
11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 13 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
12 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" 14 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
13 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" 15 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
14 #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h" 16 #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h"
15 #include "chrome/browser/ui/cocoa/run_loop_testing.h" 17 #include "chrome/browser/ui/cocoa/run_loop_testing.h"
16 #include "chrome/test/base/testing_profile.h" 18 #include "chrome/test/base/testing_profile.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 public MockConfirmInfoBarDelegate::Owner { 88 public MockConfirmInfoBarDelegate::Owner {
87 public: 89 public:
88 void SetUp() override { 90 void SetUp() override {
89 CocoaProfileTest::SetUp(); 91 CocoaProfileTest::SetUp();
90 web_contents_.reset( 92 web_contents_.reset(
91 WebContents::Create(WebContents::CreateParams(profile()))); 93 WebContents::Create(WebContents::CreateParams(profile())));
92 InfoBarService::CreateForWebContents(web_contents_.get()); 94 InfoBarService::CreateForWebContents(web_contents_.get());
93 95
94 scoped_ptr<infobars::InfoBarDelegate> delegate( 96 scoped_ptr<infobars::InfoBarDelegate> delegate(
95 new MockConfirmInfoBarDelegate(this)); 97 new MockConfirmInfoBarDelegate(this));
96 infobar_ = new InfoBarCocoa(delegate.Pass()); 98 infobar_ = new InfoBarCocoa(std::move(delegate));
97 infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get())); 99 infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get()));
98 100
99 controller_.reset([[TestConfirmInfoBarController alloc] 101 controller_.reset([[TestConfirmInfoBarController alloc]
100 initWithInfoBar:infobar_]); 102 initWithInfoBar:infobar_]);
101 infobar_->set_controller(controller_); 103 infobar_->set_controller(controller_);
102 104
103 container_.reset( 105 container_.reset(
104 [[InfoBarContainerTest alloc] initWithController:controller_]); 106 [[InfoBarContainerTest alloc] initWithController:controller_]);
105 [controller_ setContainerController:container_]; 107 [controller_ setContainerController:container_];
106 [[test_window() contentView] addSubview:[controller_ view]]; 108 [[test_window() contentView] addSubview:[controller_ view]];
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 const CGFloat width = 20; 240 const CGFloat width = 20;
239 NSRect newViewFrame = [[controller_ view] frame]; 241 NSRect newViewFrame = [[controller_ view] frame];
240 newViewFrame.size.width += width; 242 newViewFrame.size.width += width;
241 [[controller_ view] setFrame:newViewFrame]; 243 [[controller_ view] setFrame:newViewFrame];
242 244
243 NSRect newLabelFrame = [controller_ labelFrame]; 245 NSRect newLabelFrame = [controller_ labelFrame];
244 EXPECT_EQ(NSWidth(newLabelFrame), NSWidth(originalLabelFrame) + width); 246 EXPECT_EQ(NSWidth(newLabelFrame), NSWidth(originalLabelFrame) + width);
245 } 247 }
246 248
247 } // namespace 249 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm ('k') | chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698