| 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, | 41 DataUseRecorder* GetOrCreateDataUseRecorder( |
| 42 bool can_create_new) override { | 42 net::URLRequest* request) override { |
| 43 return nullptr; |
| 44 } |
| 45 DataUseRecorder* GetDataUseRecorder(const net::URLRequest& request) override { |
| 43 return nullptr; | 46 return nullptr; |
| 44 } | 47 } |
| 45 | 48 |
| 46 std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() | 49 std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() |
| 47 const override { | 50 const override { |
| 48 return nullptr; | 51 return nullptr; |
| 49 } | 52 } |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 // static | 55 // static |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 histogram_tester.ExpectTotalCount( | 227 histogram_tester.ExpectTotalCount( |
| 225 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0); | 228 "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 0); |
| 226 histogram_tester.ExpectTotalCount( | 229 histogram_tester.ExpectTotalCount( |
| 227 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0); | 230 "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 0); |
| 228 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0); | 231 histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 0); |
| 229 } | 232 } |
| 230 | 233 |
| 231 } // namespace | 234 } // namespace |
| 232 | 235 |
| 233 } // namespace data_use_measurement | 236 } // namespace data_use_measurement |
| OLD | NEW |