| 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/domain_reliability/config.h" | 5 #include "components/domain_reliability/config.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace domain_reliability { | 13 namespace domain_reliability { |
| 14 | |
| 15 namespace { | 14 namespace { |
| 16 | 15 |
| 17 scoped_ptr<DomainReliabilityConfig> MakeValidConfig() { | 16 scoped_ptr<DomainReliabilityConfig> MakeValidConfig() { |
| 18 DomainReliabilityConfig* config = new DomainReliabilityConfig(); | 17 DomainReliabilityConfig* config = new DomainReliabilityConfig(); |
| 19 config->domain = "example"; | 18 config->domain = "example"; |
| 20 config->valid_until = 1234567890.0; | 19 config->valid_until = 1234567890.0; |
| 21 config->version = "1"; | 20 config->version = "1"; |
| 22 | 21 |
| 23 DomainReliabilityConfig::Resource* resource = | 22 DomainReliabilityConfig::Resource* resource = |
| 24 new DomainReliabilityConfig::Resource(); | 23 new DomainReliabilityConfig::Resource(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 EXPECT_EQ(1u, config->resources[0]->url_patterns.size()); | 159 EXPECT_EQ(1u, config->resources[0]->url_patterns.size()); |
| 161 EXPECT_EQ("http://test.example/", *(config->resources[0]->url_patterns[0])); | 160 EXPECT_EQ("http://test.example/", *(config->resources[0]->url_patterns[0])); |
| 162 EXPECT_EQ(0.01, config->resources[0]->success_sample_rate); | 161 EXPECT_EQ(0.01, config->resources[0]->success_sample_rate); |
| 163 EXPECT_EQ(0.10, config->resources[0]->failure_sample_rate); | 162 EXPECT_EQ(0.10, config->resources[0]->failure_sample_rate); |
| 164 EXPECT_EQ(1u, config->collectors.size()); | 163 EXPECT_EQ(1u, config->collectors.size()); |
| 165 EXPECT_EQ(GURL("https://test.example/domrel/upload"), | 164 EXPECT_EQ(GURL("https://test.example/domrel/upload"), |
| 166 config->collectors[0]->upload_url); | 165 config->collectors[0]->upload_url); |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace domain_reliability | 168 } // namespace domain_reliability |
| OLD | NEW |