OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |