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

Side by Side Diff: components/feedback/feedback_data_unittest.cc

Issue 2257793002: 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/feedback/feedback_data.h" 5 #include "components/feedback/feedback_data.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 28 matching lines...) Expand all
39 }; 39 };
40 40
41 std::unique_ptr<KeyedService> CreateFeedbackUploaderService( 41 std::unique_ptr<KeyedService> CreateFeedbackUploaderService(
42 content::BrowserContext* context) { 42 content::BrowserContext* context) {
43 std::unique_ptr<MockUploader> uploader(new MockUploader(context)); 43 std::unique_ptr<MockUploader> uploader(new MockUploader(context));
44 EXPECT_CALL(*uploader, DispatchReport(testing::_)).Times(1); 44 EXPECT_CALL(*uploader, DispatchReport(testing::_)).Times(1);
45 return std::move(uploader); 45 return std::move(uploader);
46 } 46 }
47 47
48 std::unique_ptr<std::string> MakeScoped(const char* str) { 48 std::unique_ptr<std::string> MakeScoped(const char* str) {
49 return base::WrapUnique(new std::string(str)); 49 return base::MakeUnique<std::string>(str);
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 namespace feedback { 54 namespace feedback {
55 55
56 class FeedbackDataTest : public testing::Test { 56 class FeedbackDataTest : public testing::Test {
57 protected: 57 protected:
58 FeedbackDataTest() 58 FeedbackDataTest()
59 : context_(new content::TestBrowserContext()), 59 : context_(new content::TestBrowserContext()),
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 TEST_F(FeedbackDataTest, ReportSending) { 102 TEST_F(FeedbackDataTest, ReportSending) {
103 data_->SetAndCompressHistograms(MakeScoped(kHistograms)); 103 data_->SetAndCompressHistograms(MakeScoped(kHistograms));
104 data_->set_image(MakeScoped(kImageData)); 104 data_->set_image(MakeScoped(kImageData));
105 data_->AttachAndCompressFileData(MakeScoped(kFileData)); 105 data_->AttachAndCompressFileData(MakeScoped(kFileData));
106 Send(); 106 Send();
107 RunMessageLoop(); 107 RunMessageLoop();
108 EXPECT_TRUE(data_->IsDataComplete()); 108 EXPECT_TRUE(data_->IsDataComplete());
109 } 109 }
110 110
111 } // namespace feedback 111 } // namespace feedback
OLDNEW
« no previous file with comments | « components/feedback/anonymizer_tool.cc ('k') | components/feedback/feedback_uploader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698