| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ssl/chrome_expect_ct_reporter.h" | 5 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
| 12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/test/histogram_tester.h" | 14 #include "base/test/histogram_tester.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/common/chrome_features.h" | 16 #include "chrome/common/chrome_features.h" |
| 17 #include "content/public/test/test_browser_thread_bundle.h" | 17 #include "content/public/test/test_browser_thread_bundle.h" |
| 18 #include "net/ssl/signed_certificate_timestamp_and_status.h" | 18 #include "net/cert/signed_certificate_timestamp_and_status.h" |
| 19 #include "net/test/cert_test_util.h" | 19 #include "net/test/cert_test_util.h" |
| 20 #include "net/test/test_data_directory.h" | 20 #include "net/test/test_data_directory.h" |
| 21 #include "net/test/url_request/url_request_failed_job.h" | 21 #include "net/test/url_request/url_request_failed_job.h" |
| 22 #include "net/url_request/report_sender.h" | 22 #include "net/url_request/report_sender.h" |
| 23 #include "net/url_request/url_request_filter.h" | 23 #include "net/url_request/url_request_filter.h" |
| 24 #include "net/url_request/url_request_test_util.h" | 24 #include "net/url_request/url_request_test_util.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 reporter.OnExpectCTFailed(host_port, report_uri, ssl_info); | 463 reporter.OnExpectCTFailed(host_port, report_uri, ssl_info); |
| 464 EXPECT_EQ(report_uri, sender->latest_report_uri()); | 464 EXPECT_EQ(report_uri, sender->latest_report_uri()); |
| 465 EXPECT_FALSE(sender->latest_serialized_report().empty()); | 465 EXPECT_FALSE(sender->latest_serialized_report().empty()); |
| 466 ASSERT_NO_FATAL_FAILURE(CheckExpectCTReport( | 466 ASSERT_NO_FATAL_FAILURE(CheckExpectCTReport( |
| 467 sender->latest_serialized_report(), host_port, ssl_info)); | 467 sender->latest_serialized_report(), host_port, ssl_info)); |
| 468 | 468 |
| 469 histograms.ExpectTotalCount(kFailureHistogramName, 0); | 469 histograms.ExpectTotalCount(kFailureHistogramName, 0); |
| 470 histograms.ExpectTotalCount(kSendHistogramName, 1); | 470 histograms.ExpectTotalCount(kSendHistogramName, 1); |
| 471 histograms.ExpectBucketCount(kSendHistogramName, true, 1); | 471 histograms.ExpectBucketCount(kSendHistogramName, true, 1); |
| 472 } | 472 } |
| OLD | NEW |