| 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 #ifndef WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 5 #ifndef WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| 6 #define WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 6 #define WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "ios/web/public/web_client.h" | 12 #include "ios/web/public/web_client.h" |
| 13 #include "net/ssl/ssl_info.h" | 13 #include "net/ssl/ssl_info.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace web { | 16 namespace web { |
| 17 | 17 |
| 18 // A WebClient used for testing purposes. | 18 // A WebClient used for testing purposes. |
| 19 class TestWebClient : public web::WebClient { | 19 class TestWebClient : public web::WebClient { |
| 20 public: | 20 public: |
| 21 TestWebClient(); | 21 TestWebClient(); |
| 22 ~TestWebClient() override; | 22 ~TestWebClient() override; |
| 23 | 23 |
| 24 // WebClient implementation. | 24 // WebClient implementation. |
| 25 void AddAdditionalSchemes(std::vector<url::SchemeWithType>*) const override; | 25 void AddAdditionalSchemes(std::vector<url::SchemeWithType>*) const override; |
| 26 // Returns true for kTestWebUIScheme URL scheme. | 26 // Returns true for kTestWebUIScheme URL scheme. |
| 27 bool IsAppSpecificURL(const GURL& url) const override; | 27 bool IsAppSpecificURL(const GURL& url) const override; |
| 28 base::RefCountedStaticMemory* GetDataResourceBytes(int id) const override; | 28 base::RefCountedMemory* GetDataResourceBytes(int id) const override; |
| 29 NSString* GetEarlyPageScript() const override; | 29 NSString* GetEarlyPageScript() const override; |
| 30 void AllowCertificateError(WebState*, | 30 void AllowCertificateError(WebState*, |
| 31 int cert_error, | 31 int cert_error, |
| 32 const net::SSLInfo&, | 32 const net::SSLInfo&, |
| 33 const GURL&, | 33 const GURL&, |
| 34 bool overridable, | 34 bool overridable, |
| 35 const base::Callback<void(bool)>&) override; | 35 const base::Callback<void(bool)>&) override; |
| 36 | 36 |
| 37 // Changes Early Page Script for testing purposes. | 37 // Changes Early Page Script for testing purposes. |
| 38 void SetEarlyPageScript(NSString* page_script); | 38 void SetEarlyPageScript(NSString* page_script); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 52 // Last arguments passed to AllowCertificateError. | 52 // Last arguments passed to AllowCertificateError. |
| 53 int last_cert_error_code_; | 53 int last_cert_error_code_; |
| 54 net::SSLInfo last_cert_error_ssl_info_; | 54 net::SSLInfo last_cert_error_ssl_info_; |
| 55 GURL last_cert_error_request_url_; | 55 GURL last_cert_error_request_url_; |
| 56 bool last_cert_error_overridable_; | 56 bool last_cert_error_overridable_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace web | 59 } // namespace web |
| 60 | 60 |
| 61 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 61 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| OLD | NEW |