| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ | 5 #ifndef COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ |
| 6 #define COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ | 6 #define COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ |
| 7 | 7 |
| 8 #include "components/metrics/metrics_log_uploader.h" | 8 #include "components/metrics/metrics_log_uploader.h" |
| 9 | 9 |
| 10 namespace metrics { | 10 namespace metrics { |
| 11 | 11 |
| 12 class TestMetricsLogUploader : public MetricsLogUploader { | 12 class TestMetricsLogUploader : public MetricsLogUploader { |
| 13 public: | 13 public: |
| 14 TestMetricsLogUploader(const std::string& server_url, | 14 TestMetricsLogUploader(const std::string& server_url, |
| 15 const std::string& mime_type, | 15 const std::string& mime_type, |
| 16 MetricsLogUploader::MetricServiceType service_type, |
| 16 const base::Callback<void(int)>& on_upload_complete); | 17 const base::Callback<void(int)>& on_upload_complete); |
| 17 ~TestMetricsLogUploader() override; | 18 ~TestMetricsLogUploader() override; |
| 18 | 19 |
| 19 // Mark the current upload complete with the given response code. | 20 // Mark the current upload complete with the given response code. |
| 20 void CompleteUpload(int response_code); | 21 void CompleteUpload(int response_code); |
| 21 | 22 |
| 22 // Check if UploadLog has been called. | 23 // Check if UploadLog has been called. |
| 23 bool is_uploading() const { return is_uploading_; } | 24 bool is_uploading() const { return is_uploading_; } |
| 24 | 25 |
| 25 private: | 26 private: |
| 26 // MetricsLogUploader: | 27 // MetricsLogUploader: |
| 27 void UploadLog(const std::string& compressed_log_data, | 28 void UploadLog(const std::string& compressed_log_data, |
| 28 const std::string& log_hash) override; | 29 const std::string& log_hash) override; |
| 29 | 30 |
| 30 bool is_uploading_; | 31 bool is_uploading_; |
| 31 | 32 |
| 32 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader); | 33 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader); |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace metrics | 36 } // namespace metrics |
| 36 | 37 |
| 37 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ | 38 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ |
| OLD | NEW |