Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(940)

Side by Side Diff: ios/web/public/test/fakes/test_web_client.h

Issue 2741343015: Add a BrowserState* parameter to GetEarlyPageScript(). (Closed)
Patch Set: Apply review comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_CLIENT_H_ 5 #ifndef IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_CLIENT_H_
6 #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_CLIENT_H_ 6 #define IOS_WEB_PUBLIC_TEST_FAKES_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 #import "base/mac/scoped_nsobject.h" 11 #import "base/mac/scoped_nsobject.h"
12 #import "ios/web/public/web_client.h" 12 #import "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 class BrowserState;
19
18 // A WebClient used for testing purposes. 20 // A WebClient used for testing purposes.
19 class TestWebClient : public web::WebClient { 21 class TestWebClient : public web::WebClient {
20 public: 22 public:
21 TestWebClient(); 23 TestWebClient();
22 ~TestWebClient() override; 24 ~TestWebClient() override;
23 25
24 // WebClient implementation. 26 // WebClient implementation.
25 void AddAdditionalSchemes(std::vector<url::SchemeWithType>*) const override; 27 void AddAdditionalSchemes(std::vector<url::SchemeWithType>*) const override;
26 // Returns true for kTestWebUIScheme URL scheme. 28 // Returns true for kTestWebUIScheme URL scheme.
27 bool IsAppSpecificURL(const GURL& url) const override; 29 bool IsAppSpecificURL(const GURL& url) const override;
28 base::RefCountedMemory* GetDataResourceBytes(int id) const override; 30 base::RefCountedMemory* GetDataResourceBytes(int id) const override;
29 NSString* GetEarlyPageScript() const override; 31 NSString* GetEarlyPageScript(BrowserState* browser_state) const override;
30 void AllowCertificateError(WebState*, 32 void AllowCertificateError(WebState*,
31 int cert_error, 33 int cert_error,
32 const net::SSLInfo&, 34 const net::SSLInfo&,
33 const GURL&, 35 const GURL&,
34 bool overridable, 36 bool overridable,
35 const base::Callback<void(bool)>&) override; 37 const base::Callback<void(bool)>&) override;
36 38
37 // Changes Early Page Script for testing purposes. 39 // Changes Early Page Script for testing purposes.
38 void SetEarlyPageScript(NSString* page_script); 40 void SetEarlyPageScript(NSString* page_script);
39 41
(...skipping 12 matching lines...) Expand all
52 // Last arguments passed to AllowCertificateError. 54 // Last arguments passed to AllowCertificateError.
53 int last_cert_error_code_; 55 int last_cert_error_code_;
54 net::SSLInfo last_cert_error_ssl_info_; 56 net::SSLInfo last_cert_error_ssl_info_;
55 GURL last_cert_error_request_url_; 57 GURL last_cert_error_request_url_;
56 bool last_cert_error_overridable_; 58 bool last_cert_error_overridable_;
57 }; 59 };
58 60
59 } // namespace web 61 } // namespace web
60 62
61 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_CLIENT_H_ 63 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_CLIENT_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/web/early_page_script_perftest.mm ('k') | ios/web/public/test/fakes/test_web_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698