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 "net/base/layered_network_delegate.h" | 5 #include "net/base/layered_network_delegate.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const GURL& target_url, | 328 const GURL& target_url, |
329 const GURL& referrer_url) const override { | 329 const GURL& referrer_url) const override { |
330 ++(*counters_) | 330 ++(*counters_) |
331 ["on_cancel_url_request_with_policy_" | 331 ["on_cancel_url_request_with_policy_" |
332 "violating_referrer_header_count"]; | 332 "violating_referrer_header_count"]; |
333 EXPECT_EQ(1, (*counters_) | 333 EXPECT_EQ(1, (*counters_) |
334 ["on_cancel_url_request_with_policy_" | 334 ["on_cancel_url_request_with_policy_" |
335 "violating_referrer_header_count"]); | 335 "violating_referrer_header_count"]); |
336 } | 336 } |
337 | 337 |
| 338 void OnCanQueueReportingReportInternal( |
| 339 const url::Origin& origin) const override { |
| 340 ++(*counters_)["on_can_queue_reporting_report_count"]; |
| 341 EXPECT_EQ(1, (*counters_)["on_can_queue_reporting_report_count"]); |
| 342 } |
| 343 |
| 344 void OnCanSendReportingReportInternal( |
| 345 const url::Origin& origin) const override { |
| 346 ++(*counters_)["on_can_send_reporting_report_count"]; |
| 347 EXPECT_EQ(1, (*counters_)["on_can_send_reporting_report_count"]); |
| 348 } |
| 349 |
| 350 void OnCanSetReportingClientInternal(const url::Origin& origin, |
| 351 const GURL& endpoint) const override { |
| 352 ++(*counters_)["on_can_set_reporting_client_count"]; |
| 353 EXPECT_EQ(1, (*counters_)["on_can_set_reporting_client_count"]); |
| 354 } |
| 355 |
| 356 void OnCanUseReportingClientInternal(const url::Origin& origin, |
| 357 const GURL& endpoint) const override { |
| 358 ++(*counters_)["on_can_use_reporting_client_count"]; |
| 359 EXPECT_EQ(1, (*counters_)["on_can_use_reporting_client_count"]); |
| 360 } |
| 361 |
338 private: | 362 private: |
339 TestURLRequestContext context_; | 363 TestURLRequestContext context_; |
340 TestDelegate delegate_; | 364 TestDelegate delegate_; |
341 mutable CountersMap* counters_; | 365 mutable CountersMap* counters_; |
342 | 366 |
343 DISALLOW_COPY_AND_ASSIGN(TestLayeredNetworkDelegate); | 367 DISALLOW_COPY_AND_ASSIGN(TestLayeredNetworkDelegate); |
344 }; | 368 }; |
345 | 369 |
346 } // namespace | 370 } // namespace |
347 | 371 |
(...skipping 11 matching lines...) Expand all Loading... |
359 CountersMap layered_network_delegate_counters; | 383 CountersMap layered_network_delegate_counters; |
360 TestNetworkDelegateImpl* test_network_delegate_; | 384 TestNetworkDelegateImpl* test_network_delegate_; |
361 std::unique_ptr<TestLayeredNetworkDelegate> layered_network_delegate_; | 385 std::unique_ptr<TestLayeredNetworkDelegate> layered_network_delegate_; |
362 }; | 386 }; |
363 | 387 |
364 TEST_F(LayeredNetworkDelegateTest, VerifyLayeredNetworkDelegateInternal) { | 388 TEST_F(LayeredNetworkDelegateTest, VerifyLayeredNetworkDelegateInternal) { |
365 layered_network_delegate_->CallAndVerify(); | 389 layered_network_delegate_->CallAndVerify(); |
366 } | 390 } |
367 | 391 |
368 } // namespace net | 392 } // namespace net |
OLD | NEW |