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_uploader.h" | 5 #include "components/feedback/feedback_uploader.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 FeedbackUploaderFactory::GetInstance()->SetTestingFactory( | 50 FeedbackUploaderFactory::GetInstance()->SetTestingFactory( |
51 context_.get(), &CreateFeedbackUploaderService); | 51 context_.get(), &CreateFeedbackUploaderService); |
52 | 52 |
53 uploader_ = FeedbackUploaderFactory::GetForBrowserContext(context_.get()); | 53 uploader_ = FeedbackUploaderFactory::GetForBrowserContext(context_.get()); |
54 uploader_->setup_for_test( | 54 uploader_->setup_for_test( |
55 base::Bind(&FeedbackUploaderTest::MockDispatchReport, | 55 base::Bind(&FeedbackUploaderTest::MockDispatchReport, |
56 base::Unretained(this)), | 56 base::Unretained(this)), |
57 kRetryDelayForTest); | 57 kRetryDelayForTest); |
58 } | 58 } |
59 | 59 |
60 virtual ~FeedbackUploaderTest() { | 60 ~FeedbackUploaderTest() override { |
61 FeedbackUploaderFactory::GetInstance()->SetTestingFactory( | 61 FeedbackUploaderFactory::GetInstance()->SetTestingFactory( |
62 context_.get(), NULL); | 62 context_.get(), NULL); |
63 } | 63 } |
64 | 64 |
65 void QueueReport(const std::string& data) { | 65 void QueueReport(const std::string& data) { |
66 uploader_->QueueReport(data); | 66 uploader_->QueueReport(data); |
67 } | 67 } |
68 | 68 |
69 void ReportFailure(const std::string& data) { | 69 void ReportFailure(const std::string& data) { |
70 uploader_->RetryReport(data); | 70 uploader_->RetryReport(data); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 EXPECT_EQ(dispatched_reports_.size(), 5u); | 156 EXPECT_EQ(dispatched_reports_.size(), 5u); |
157 EXPECT_EQ(dispatched_reports_[kReportOne], 1u); | 157 EXPECT_EQ(dispatched_reports_[kReportOne], 1u); |
158 EXPECT_EQ(dispatched_reports_[kReportTwo], 2u); | 158 EXPECT_EQ(dispatched_reports_[kReportTwo], 2u); |
159 EXPECT_EQ(dispatched_reports_[kReportThree], 2u); | 159 EXPECT_EQ(dispatched_reports_[kReportThree], 2u); |
160 EXPECT_EQ(dispatched_reports_[kReportFour], 1u); | 160 EXPECT_EQ(dispatched_reports_[kReportFour], 1u); |
161 EXPECT_EQ(dispatched_reports_[kReportFive], 1u); | 161 EXPECT_EQ(dispatched_reports_[kReportFive], 1u); |
162 } | 162 } |
163 | 163 |
164 } // namespace feedback | 164 } // namespace feedback |
OLD | NEW |