Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ios / web / public / test / test_web_state.h
blob9d31c84cdc97fed6c216d09ad785941fca0183a5
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.
5 #ifndef IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_
6 #define IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_
8 #include <string>
10 #include "ios/web/public/web_state/url_verification_constants.h"
11 #include "ios/web/public/web_state/web_state.h"
12 #include "url/gurl.h"
14 namespace web {
16 // Minimal implementation of WebState, to be used in tests.
17 class TestWebState : public WebState {
18 public:
19 TestWebState();
20 ~TestWebState() override;
22 // WebState implementation.
23 UIView* GetView() override;
24 WebViewType GetWebViewType() const override;
25 BrowserState* GetBrowserState() const override;
26 void OpenURL(const OpenURLParams& params) override {}
27 NavigationManager* GetNavigationManager() override;
28 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override;
29 const std::string& GetContentsMimeType() const override;
30 const std::string& GetContentLanguageHeader() const override;
31 bool ContentIsHTML() const override;
32 const GURL& GetVisibleURL() const override;
33 const GURL& GetLastCommittedURL() const override;
34 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override;
35 void AddScriptCommandCallback(const ScriptCommandCallback& callback,
36 const std::string& command_prefix) override {}
37 void RemoveScriptCommandCallback(const std::string& command_prefix) override {
39 CRWWebViewProxyType GetWebViewProxy() const override;
40 bool IsShowingWebInterstitial() const override;
41 WebInterstitial* GetWebInterstitial() const override;
42 void AddObserver(WebStateObserver* observer) override {}
43 void RemoveObserver(WebStateObserver* observer) override {}
44 int DownloadImage(const GURL& url,
45 bool is_favicon,
46 uint32_t max_bitmap_size,
47 bool bypass_cache,
48 const ImageDownloadCallback& callback) override;
50 // Setters for test data.
51 void SetContentIsHTML(bool content_is_html);
52 void SetCurrentURL(const GURL& url);
53 void SetTrustLevel(URLVerificationTrustLevel trust_level);
55 private:
56 GURL url_;
57 URLVerificationTrustLevel trust_level_;
58 bool content_is_html_;
59 std::string mime_type_;
60 std::string content_language_;
63 } // namespace web
65 #endif // IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_