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 #include "ios/web/public/test/test_web_state.h"
9 TestWebState::TestWebState() : trust_level_(kAbsolute
), content_is_html_(true) {
12 TestWebState::~TestWebState() = default;
14 UIView
* TestWebState::GetView() {
18 WebViewType
TestWebState::GetWebViewType() const {
19 return web::UI_WEB_VIEW_TYPE
;
22 BrowserState
* TestWebState::GetBrowserState() const {
26 NavigationManager
* TestWebState::GetNavigationManager() {
30 CRWJSInjectionReceiver
* TestWebState::GetJSInjectionReceiver() const {
34 const std::string
& TestWebState::GetContentsMimeType() const {
38 const std::string
& TestWebState::GetContentLanguageHeader() const {
39 return content_language_
;
42 bool TestWebState::ContentIsHTML() const {
43 return content_is_html_
;
46 const GURL
& TestWebState::GetVisibleURL() const {
50 const GURL
& TestWebState::GetLastCommittedURL() const {
54 GURL
TestWebState::GetCurrentURL(URLVerificationTrustLevel
* trust_level
) const {
55 *trust_level
= trust_level_
;
59 bool TestWebState::IsShowingWebInterstitial() const {
63 WebInterstitial
* TestWebState::GetWebInterstitial() const {
67 void TestWebState::SetContentIsHTML(bool content_is_html
) {
68 content_is_html_
= content_is_html
;
71 void TestWebState::SetCurrentURL(const GURL
& url
) {
75 void TestWebState::SetTrustLevel(URLVerificationTrustLevel trust_level
) {
76 trust_level_
= trust_level
;
79 CRWWebViewProxyType
TestWebState::GetWebViewProxy() const {