| 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 "components/data_use_measurement/core/data_use_network_delegate.h" | 5 #include "components/data_use_measurement/core/data_use_network_delegate.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
| 10 #include "components/data_use_measurement/core/data_use_ascriber.h" | 10 #include "components/data_use_measurement/core/data_use_ascriber.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 static void MarkAsUserRequest(net::URLRequest* request) { | 32 static void MarkAsUserRequest(net::URLRequest* request) { |
| 33 request->SetUserData(kUserDataKey, new UserRequestUserDataForTesting()); | 33 request->SetUserData(kUserDataKey, new UserRequestUserDataForTesting()); |
| 34 } | 34 } |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 class TestDataUseAscriber : public DataUseAscriber { | 37 class TestDataUseAscriber : public DataUseAscriber { |
| 38 public: | 38 public: |
| 39 TestDataUseAscriber() {} | 39 TestDataUseAscriber() {} |
| 40 | 40 |
| 41 DataUseRecorder* GetDataUseRecorder(net::URLRequest* request) override { | 41 DataUseRecorder* GetDataUseRecorder(net::URLRequest* request, |
| 42 bool can_create_new) override { |
| 42 return nullptr; | 43 return nullptr; |
| 43 } | 44 } |
| 44 | 45 |
| 45 std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() | 46 std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() |
| 46 const override { | 47 const override { |
| 47 return nullptr; | 48 return nullptr; |
| 48 } | 49 } |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 // static | 52 // static |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 histogram_tester.ExpectTotalCount( | 224 histogram_tester.ExpectTotalCount( |
| 224 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0); | 225 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0); |
| 225 histogram_tester.ExpectTotalCount( | 226 histogram_tester.ExpectTotalCount( |
| 226 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0); | 227 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0); |
| 227 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0); | 228 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0); |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace | 231 } // namespace |
| 231 | 232 |
| 232 } // namespace data_use_measurement | 233 } // namespace data_use_measurement |
| OLD | NEW |