Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/url_request/url_request_throttler_manager.h" | 5 #include "net/url_request/url_request_throttler_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 // Host doesn't really matter in this scenario so we skip it. | 504 // Host doesn't really matter in this scenario so we skip it. |
| 505 entry_before->UpdateWithResponse("", &failure_adapter); | 505 entry_before->UpdateWithResponse("", &failure_adapter); |
| 506 } | 506 } |
| 507 EXPECT_TRUE(entry_before->ShouldRejectRequest(0)); | 507 EXPECT_TRUE(entry_before->ShouldRejectRequest(0)); |
| 508 | 508 |
| 509 switch (i) { | 509 switch (i) { |
| 510 case 0: | 510 case 0: |
| 511 manager.OnIPAddressChanged(); | 511 manager.OnIPAddressChanged(); |
| 512 break; | 512 break; |
| 513 case 1: | 513 case 1: |
| 514 manager.OnOnlineStateChanged(true); | 514 manager.OnConnectionTypeChanged( |
| 515 net::NetworkChangeNotifier::CONNECTION_ETHERNET); | |
|
wtc
2012/05/11 01:35:05
Nit: CONNECTION_UNKNOWN seems better than CONNECTI
| |
| 515 break; | 516 break; |
| 516 case 2: | 517 case 2: |
| 517 manager.OnOnlineStateChanged(false); | 518 manager.OnConnectionTypeChanged( |
| 519 net::NetworkChangeNotifier::CONNECTION_NONE); | |
| 518 break; | 520 break; |
| 519 default: | 521 default: |
| 520 FAIL(); | 522 FAIL(); |
| 521 } | 523 } |
| 522 | 524 |
| 523 scoped_refptr<net::URLRequestThrottlerEntryInterface> entry_after = | 525 scoped_refptr<net::URLRequestThrottlerEntryInterface> entry_after = |
| 524 manager.RegisterRequestUrl(GURL("http://www.example.com/")); | 526 manager.RegisterRequestUrl(GURL("http://www.example.com/")); |
| 525 EXPECT_FALSE(entry_after->ShouldRejectRequest(0)); | 527 EXPECT_FALSE(entry_after->ShouldRejectRequest(0)); |
| 526 } | 528 } |
| 527 } | 529 } |
| 528 | 530 |
| 529 } // namespace net | 531 } // namespace net |
| OLD | NEW |