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

Side by Side Diff: chrome/browser/ui/views/certificate_selector_browsertest.cc

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/views/certificate_selector.h" 5 #include "chrome/browser/ui/views/certificate_selector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 18 matching lines...) Expand all
29 TestCertificateSelector(const net::CertificateList& certificates, 29 TestCertificateSelector(const net::CertificateList& certificates,
30 content::WebContents* web_contents) 30 content::WebContents* web_contents)
31 : CertificateSelector(certificates, web_contents) {} 31 : CertificateSelector(certificates, web_contents) {}
32 32
33 ~TestCertificateSelector() override { 33 ~TestCertificateSelector() override {
34 if (!on_destroy_.is_null()) 34 if (!on_destroy_.is_null())
35 on_destroy_.Run(); 35 on_destroy_.Run();
36 } 36 }
37 37
38 void Init() { 38 void Init() {
39 InitWithText(base::WrapUnique( 39 InitWithText(base::MakeUnique<views::Label>(
40 new views::Label(base::ASCIIToUTF16("some arbitrary text")))); 40 base::ASCIIToUTF16("some arbitrary text")));
41 } 41 }
42 42
43 bool Accept() override { 43 bool Accept() override {
44 if (accepted_) 44 if (accepted_)
45 *accepted_ = true; 45 *accepted_ = true;
46 return CertificateSelector::Accept(); 46 return CertificateSelector::Accept();
47 } 47 }
48 48
49 bool Cancel() override { 49 bool Cancel() override {
50 if (canceled_) 50 if (canceled_)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 selector_->OnDoubleClick(); 149 selector_->OnDoubleClick();
150 150
151 // Wait for the dialog to be closed and destroyed. 151 // Wait for the dialog to be closed and destroyed.
152 loop.Run(); 152 loop.Run();
153 153
154 // Closing the dialog through a double click must call only the Accept() 154 // Closing the dialog through a double click must call only the Accept()
155 // function and not Cancel(). 155 // function and not Cancel().
156 EXPECT_TRUE(accepted); 156 EXPECT_TRUE(accepted);
157 EXPECT_FALSE(canceled); 157 EXPECT_FALSE(canceled);
158 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/download/download_item_view_md.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698