[iOS] Upstream files in //ios/chrome/browser/autofill
[chromium-blink-merge.git] / ios / web / public / test / test_web_state.cc
blobf98f28cb1295387afa1c595f5fa8bda6cafe0941
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"
7 namespace web {
9 TestWebState::TestWebState() : trust_level_(kAbsolute), content_is_html_(true) {
12 TestWebState::~TestWebState() = default;
14 UIView* TestWebState::GetView() {
15 return nullptr;
18 WebViewType TestWebState::GetWebViewType() const {
19 return web::UI_WEB_VIEW_TYPE;
22 BrowserState* TestWebState::GetBrowserState() const {
23 return nullptr;
26 NavigationManager* TestWebState::GetNavigationManager() {
27 return nullptr;
30 CRWJSInjectionReceiver* TestWebState::GetJSInjectionReceiver() const {
31 return nullptr;
34 const std::string& TestWebState::GetContentsMimeType() const {
35 return mime_type_;
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 {
47 return url_;
50 const GURL& TestWebState::GetLastCommittedURL() const {
51 return url_;
54 GURL TestWebState::GetCurrentURL(URLVerificationTrustLevel* trust_level) const {
55 *trust_level = trust_level_;
56 return url_;
59 bool TestWebState::IsShowingWebInterstitial() const {
60 return false;
63 WebInterstitial* TestWebState::GetWebInterstitial() const {
64 return nullptr;
67 void TestWebState::SetContentIsHTML(bool content_is_html) {
68 content_is_html_ = content_is_html;
71 void TestWebState::SetCurrentURL(const GURL& url) {
72 url_ = url;
75 void TestWebState::SetTrustLevel(URLVerificationTrustLevel trust_level) {
76 trust_level_ = trust_level;
79 CRWWebViewProxyType TestWebState::GetWebViewProxy() const {
80 return nullptr;
83 } // namespace web