| 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/network_time/network_time_tracker.h" | 5 #include "components/network_time/network_time_tracker.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 15 #include "base/test/histogram_tester.h" | 16 #include "base/test/histogram_tester.h" |
| 16 #include "base/test/simple_test_clock.h" | 17 #include "base/test/simple_test_clock.h" |
| 17 #include "base/test/simple_test_tick_clock.h" | 18 #include "base/test/simple_test_tick_clock.h" |
| 18 #include "components/client_update_protocol/ecdsa.h" | 19 #include "components/client_update_protocol/ecdsa.h" |
| 19 #include "components/network_time/network_time_pref_names.h" | 20 #include "components/network_time/network_time_pref_names.h" |
| 20 #include "components/network_time/network_time_test_utils.h" | 21 #include "components/network_time/network_time_test_utils.h" |
| 21 #include "components/prefs/testing_pref_service.h" | 22 #include "components/prefs/testing_pref_service.h" |
| 22 #include "net/http/http_response_headers.h" | 23 #include "net/http/http_response_headers.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 tracker_->GetNetworkTime(&out_network_time, nullptr)); | 939 tracker_->GetNetworkTime(&out_network_time, nullptr)); |
| 939 histograms.ExpectTotalCount(kTimeBetweenFetchesHistogram, 1); | 940 histograms.ExpectTotalCount(kTimeBetweenFetchesHistogram, 1); |
| 940 histograms.ExpectBucketCount( | 941 histograms.ExpectBucketCount( |
| 941 kTimeBetweenFetchesHistogram, | 942 kTimeBetweenFetchesHistogram, |
| 942 (response_handler.GetTimeAtIndex(1) - response_handler.GetTimeAtIndex(0)) | 943 (response_handler.GetTimeAtIndex(1) - response_handler.GetTimeAtIndex(0)) |
| 943 .InMilliseconds(), | 944 .InMilliseconds(), |
| 944 1); | 945 1); |
| 945 } | 946 } |
| 946 | 947 |
| 947 } // namespace network_time | 948 } // namespace network_time |
| OLD | NEW |