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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 void QueueReport(const std::string& data) { | 71 void QueueReport(const std::string& data) { |
72 uploader_->QueueReport(data); | 72 uploader_->QueueReport(data); |
73 } | 73 } |
74 | 74 |
75 void ReportFailure(const std::string& data) { | 75 void ReportFailure(const std::string& data) { |
76 uploader_->RetryReport(data); | 76 uploader_->RetryReport(data); |
77 } | 77 } |
78 | 78 |
79 void MockDispatchReport(const std::string& report_data) { | 79 void MockDispatchReport(const std::string& report_data) { |
80 if (ContainsKey(dispatched_reports_, report_data)) { | 80 if (base::ContainsKey(dispatched_reports_, report_data)) { |
81 dispatched_reports_[report_data]++; | 81 dispatched_reports_[report_data]++; |
82 } else { | 82 } else { |
83 dispatched_reports_[report_data] = 1; | 83 dispatched_reports_[report_data] = 1; |
84 } | 84 } |
85 dispatched_reports_count_++; | 85 dispatched_reports_count_++; |
86 | 86 |
87 // Dispatch will always update the timer, whether successful or not, | 87 // Dispatch will always update the timer, whether successful or not, |
88 // simulate the same behavior. | 88 // simulate the same behavior. |
89 uploader_->UpdateUploadTimer(); | 89 uploader_->UpdateUploadTimer(); |
90 | 90 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 EXPECT_EQ(dispatched_reports_.size(), 5u); | 162 EXPECT_EQ(dispatched_reports_.size(), 5u); |
163 EXPECT_EQ(dispatched_reports_[kReportOne], 1u); | 163 EXPECT_EQ(dispatched_reports_[kReportOne], 1u); |
164 EXPECT_EQ(dispatched_reports_[kReportTwo], 2u); | 164 EXPECT_EQ(dispatched_reports_[kReportTwo], 2u); |
165 EXPECT_EQ(dispatched_reports_[kReportThree], 2u); | 165 EXPECT_EQ(dispatched_reports_[kReportThree], 2u); |
166 EXPECT_EQ(dispatched_reports_[kReportFour], 1u); | 166 EXPECT_EQ(dispatched_reports_[kReportFour], 1u); |
167 EXPECT_EQ(dispatched_reports_[kReportFive], 1u); | 167 EXPECT_EQ(dispatched_reports_[kReportFive], 1u); |
168 } | 168 } |
169 | 169 |
170 } // namespace feedback | 170 } // namespace feedback |
OLD | NEW |