| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ | 5 #ifndef COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ |
| 6 #define COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ | 6 #define COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <Cronet/Cronet.h> | 8 #include <Cronet/Cronet.h> |
| 9 #include "net/cert/cert_verifier.h" | 9 #include "net/cert/cert_verifier.h" |
| 10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 #pragma mark | 13 #pragma mark |
| 14 | 14 |
| 15 // Exposes private test-only methods of the Cronet class. | 15 // Exposes private test-only methods of the Cronet class. |
| 16 @interface Cronet (ExposedForTesting) | 16 @interface Cronet (ExposedForTesting) |
| 17 + (void)shutdownForTesting; | 17 + (void)shutdownForTesting; |
| 18 + (void)setMockCertVerifierForTesting: | 18 + (void)setMockCertVerifierForTesting: |
| 19 (std::unique_ptr<net::CertVerifier>)certVerifier; | 19 (std::unique_ptr<net::CertVerifier>)certVerifier; |
| 20 + (void)setEnablePublicKeyPinningBypassForLocalTrustAnchors:(BOOL)enable; |
| 20 @end | 21 @end |
| 21 | 22 |
| 22 // NSURLSessionDataDelegate delegate implementation used by the tests to | 23 // NSURLSessionDataDelegate delegate implementation used by the tests to |
| 23 // wait for a response and check its status. | 24 // wait for a response and check its status. |
| 24 @interface TestDelegate : NSObject<NSURLSessionDataDelegate> | 25 @interface TestDelegate : NSObject<NSURLSessionDataDelegate> |
| 25 | 26 |
| 26 // Error the request this delegate is attached to failed with, if any. | 27 // Error the request this delegate is attached to failed with, if any. |
| 27 @property(retain, atomic) NSError* error; | 28 @property(retain, atomic) NSError* error; |
| 28 | 29 |
| 29 // Contains total amount of received data. | 30 // Contains total amount of received data. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool known_root); | 65 bool known_root); |
| 65 | 66 |
| 66 ::testing::AssertionResult IsResponseSuccessful(); | 67 ::testing::AssertionResult IsResponseSuccessful(); |
| 67 | 68 |
| 68 TestDelegate* delegate_; | 69 TestDelegate* delegate_; |
| 69 }; // class CronetTestBase | 70 }; // class CronetTestBase |
| 70 | 71 |
| 71 } // namespace cronet | 72 } // namespace cronet |
| 72 | 73 |
| 73 #endif // COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ | 74 #endif // COMPONENTS_CRONET_IOS_TEST_CRONET_TEST_BASE_H_ |
| OLD | NEW |