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

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

Issue 1043243003: Upstream most of ios/web/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove accidentally-added clients Created 5 years, 8 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
« no previous file with comments | « ios/web/public/cert_store.h ('k') | ios/web/public/test/test_web_client.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_
6 #define WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_
7
8 #import <Foundation/Foundation.h>
9
10 #include "base/compiler_specific.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "ios/web/public/web_client.h"
14
15 namespace web {
16
17 class WebViewFactory;
18
19 // A WebClient used for testing purposes.
20 class TestWebClient : public web::WebClient {
21 public:
22 TestWebClient();
23 ~TestWebClient() override;
24 // WebClient implementation.
25 std::string GetUserAgent(bool is_desktop_user_agent) const override;
26 NSString* GetEarlyPageScript(web::WebViewType web_view_type) const override;
27
28 // Changes the user agent for testing purposes. Passing true
29 // for |is_desktop_user_agent| affects the result of GetUserAgent(true) call.
30 // Passing false affects the result of GetUserAgent(false).
31 void SetUserAgent(const std::string& user_agent, bool is_desktop_user_agent);
32
33 // Changes Early Page Script for testing purposes.
34 void SetEarlyPageScript(NSString* page_script,
35 web::WebViewType web_view_type);
36
37 private:
38 std::string user_agent_;
39 std::string desktop_user_agent_;
40 base::scoped_nsobject<NSMutableDictionary> early_page_scripts_;
41 };
42
43 } // namespace web
44
45 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_
OLDNEW
« no previous file with comments | « ios/web/public/cert_store.h ('k') | ios/web/public/test/test_web_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698