| 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; |
| 26 // Returns true for kTestWebUIScheme URL scheme. |
| 27 bool IsAppSpecificURL(const GURL& url) const override; |
| 25 NSString* GetEarlyPageScript() const override; | 28 NSString* GetEarlyPageScript() const override; |
| 26 void AllowCertificateError(WebState*, | 29 void AllowCertificateError(WebState*, |
| 27 int cert_error, | 30 int cert_error, |
| 28 const net::SSLInfo&, | 31 const net::SSLInfo&, |
| 29 const GURL&, | 32 const GURL&, |
| 30 bool overridable, | 33 bool overridable, |
| 31 const base::Callback<void(bool)>&) override; | 34 const base::Callback<void(bool)>&) override; |
| 32 | 35 |
| 33 // Changes Early Page Script for testing purposes. | 36 // Changes Early Page Script for testing purposes. |
| 34 void SetEarlyPageScript(NSString* page_script); | 37 void SetEarlyPageScript(NSString* page_script); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 // Last arguments passed to AllowCertificateError. | 51 // Last arguments passed to AllowCertificateError. |
| 49 int last_cert_error_code_; | 52 int last_cert_error_code_; |
| 50 net::SSLInfo last_cert_error_ssl_info_; | 53 net::SSLInfo last_cert_error_ssl_info_; |
| 51 GURL last_cert_error_request_url_; | 54 GURL last_cert_error_request_url_; |
| 52 bool last_cert_error_overridable_; | 55 bool last_cert_error_overridable_; |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace web | 58 } // namespace web |
| 56 | 59 |
| 57 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 60 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| OLD | NEW |