| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/web/net/request_tracker_impl.h" | 5 #include "ios/web/net/request_tracker_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 // Used and incremented each time a tabId is created. | 123 // Used and incremented each time a tabId is created. |
| 124 int g_count = 0; | 124 int g_count = 0; |
| 125 | 125 |
| 126 // URLRequest::Delegate that does nothing. | 126 // URLRequest::Delegate that does nothing. |
| 127 class DummyURLRequestDelegate : public net::URLRequest::Delegate { | 127 class DummyURLRequestDelegate : public net::URLRequest::Delegate { |
| 128 public: | 128 public: |
| 129 DummyURLRequestDelegate() {} | 129 DummyURLRequestDelegate() {} |
| 130 ~DummyURLRequestDelegate() override {} | 130 ~DummyURLRequestDelegate() override {} |
| 131 | 131 |
| 132 void OnResponseStarted(net::URLRequest* request) override {} | 132 void OnResponseStarted(net::URLRequest* request, int net_error) override {} |
| 133 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} | 133 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 DISALLOW_COPY_AND_ASSIGN(DummyURLRequestDelegate); | 136 DISALLOW_COPY_AND_ASSIGN(DummyURLRequestDelegate); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 class RequestTrackerTest : public PlatformTest { | 139 class RequestTrackerTest : public PlatformTest { |
| 140 public: | 140 public: |
| 141 RequestTrackerTest() | 141 RequestTrackerTest() |
| 142 : loop_(base::MessageLoop::TYPE_IO), | 142 : loop_(base::MessageLoop::TYPE_IO), |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 base::Bind(&TwoStartsSSLCallback, | 503 base::Bind(&TwoStartsSSLCallback, |
| 504 &request_0_called)); | 504 &request_0_called)); |
| 505 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, | 505 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, |
| 506 base::Bind(&TwoStartsSSLCallback, | 506 base::Bind(&TwoStartsSSLCallback, |
| 507 &request_1_called)); | 507 &request_1_called)); |
| 508 EXPECT_TRUE(request_0_called); | 508 EXPECT_TRUE(request_0_called); |
| 509 EXPECT_TRUE(request_1_called); | 509 EXPECT_TRUE(request_1_called); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace | 512 } // namespace |
| OLD | NEW |