Chromium Code Reviews| Index: chrome/browser/ssl/certificate_reporting_test_utils.cc |
| diff --git a/chrome/browser/ssl/certificate_reporting_test_utils.cc b/chrome/browser/ssl/certificate_reporting_test_utils.cc |
| index 433694b444b54f0229254136c0437a076ca1f0e5..2fae72922357caeacfed3c88b221f8387891a3be 100644 |
| --- a/chrome/browser/ssl/certificate_reporting_test_utils.cc |
| +++ b/chrome/browser/ssl/certificate_reporting_test_utils.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/metrics/field_trial.h" |
| #include "base/prefs/pref_service.h" |
| #include "base/run_loop.h" |
| +#include "base/strings/string_number_conversions.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/safe_browsing/ping_manager.h" |
| @@ -163,22 +164,22 @@ scoped_ptr<SSLCertReporter> SetUpMockSSLCertReporter( |
| return ssl_cert_reporter.Pass(); |
| } |
| -// Helper function to set the Finch options. |
| -void SetCertReportingFinchConfig(const std::string& group_name, |
| - const std::string& param_value) { |
| - base::FieldTrialList::CreateFieldTrial(CertReportHelper::kFinchExperimentName, |
| - group_name); |
| - if (!param_value.empty()) { |
| - std::map<std::string, std::string> params; |
| - params[CertReportHelper::kFinchParamName] = param_value; |
| - variations::AssociateVariationParams(CertReportHelper::kFinchExperimentName, |
| - group_name, params); |
| - } |
| -} |
| +ExpectReport GetReportExpectedFromFinch() { |
| + const std::string group_name = base::FieldTrialList::FindFullName( |
| + CertReportHelper::kFinchExperimentName); |
| -// Helper function to set the Finch options in case we have no parameter. |
| -void SetCertReportingFinchConfig(const std::string& group_name) { |
| - SetCertReportingFinchConfig(group_name, std::string()); |
| + if (group_name == CertReportHelper::kFinchGroupShowPossiblySend) { |
| + const std::string param = variations::GetVariationParamValue( |
| + CertReportHelper::kFinchExperimentName, |
| + CertReportHelper::kFinchParamName); |
| + double sendingThreshold; |
| + if (!base::StringToDouble(param, &sendingThreshold)) |
| + return CERT_REPORT_NOT_EXPECTED; |
| + |
| + if (sendingThreshold == 1.0) |
|
meacer
2015/07/21 06:04:31
You might want to compare sendingThreshold against
estark
2015/07/21 14:50:09
I was actually hoping to try to discourage Finch c
meacer
2015/07/21 17:36:25
Not sure if that check would be reliable either, b
|
| + return CertificateReportingTestUtils::CERT_REPORT_EXPECTED; |
| + } |
| + return CertificateReportingTestUtils::CERT_REPORT_NOT_EXPECTED; |
| } |
| } // namespace CertificateReportingTestUtils |