Commit dc883177 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Remove const interfaces from content/public/test.

Bug: 908139
Change-Id: I5ade2d364906e02be87c819d7a97a13f767f1ddc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1676236Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672217}
parent d42db43d
...@@ -117,7 +117,7 @@ class CorsFileOriginBrowserTest ...@@ -117,7 +117,7 @@ class CorsFileOriginBrowserTest
} }
private: private:
bool AllowFileAccessFromFiles() const override { return false; } bool AllowFileAccessFromFiles() override { return false; }
virtual bool IsWebSecurityEnabled() const { return true; } virtual bool IsWebSecurityEnabled() const { return true; }
void SetUpCommandLine(base::CommandLine* command_line) override { void SetUpCommandLine(base::CommandLine* command_line) override {
...@@ -200,7 +200,7 @@ class CorsFileOriginBrowserTest ...@@ -200,7 +200,7 @@ class CorsFileOriginBrowserTest
class CorsFileOriginBrowserTestWithAllowFileAccessFromFiles class CorsFileOriginBrowserTestWithAllowFileAccessFromFiles
: public CorsFileOriginBrowserTest { : public CorsFileOriginBrowserTest {
private: private:
bool AllowFileAccessFromFiles() const override { return true; } bool AllowFileAccessFromFiles() override { return true; }
}; };
// Tests end to end Origin header and CORS check behaviors with // Tests end to end Origin header and CORS check behaviors with
...@@ -208,7 +208,7 @@ class CorsFileOriginBrowserTestWithAllowFileAccessFromFiles ...@@ -208,7 +208,7 @@ class CorsFileOriginBrowserTestWithAllowFileAccessFromFiles
class CorsFileOriginBrowserTestWithDisableWebSecurity class CorsFileOriginBrowserTestWithDisableWebSecurity
: public CorsFileOriginBrowserTest { : public CorsFileOriginBrowserTest {
private: private:
bool AllowFileAccessFromFiles() const override { return false; } bool AllowFileAccessFromFiles() override { return false; }
bool IsWebSecurityEnabled() const override { return false; } bool IsWebSecurityEnabled() const override { return false; }
}; };
......
...@@ -483,7 +483,7 @@ void BrowserTestBase::TearDown() { ...@@ -483,7 +483,7 @@ void BrowserTestBase::TearDown() {
#endif #endif
} }
bool BrowserTestBase::AllowFileAccessFromFiles() const { bool BrowserTestBase::AllowFileAccessFromFiles() {
return true; return true;
} }
......
...@@ -52,7 +52,7 @@ class BrowserTestBase : public testing::Test { ...@@ -52,7 +52,7 @@ class BrowserTestBase : public testing::Test {
virtual void SetUpCommandLine(base::CommandLine* command_line) {} virtual void SetUpCommandLine(base::CommandLine* command_line) {}
// Override this to disallow accesses to be production-compatible. // Override this to disallow accesses to be production-compatible.
virtual bool AllowFileAccessFromFiles() const; virtual bool AllowFileAccessFromFiles();
// Crash the Network Service process. Should only be called when // Crash the Network Service process. Should only be called when
// out-of-process Network Service is enabled. Re-applies any added host // out-of-process Network Service is enabled. Re-applies any added host
......
...@@ -302,13 +302,13 @@ class NavigationSimulator { ...@@ -302,13 +302,13 @@ class NavigationSimulator {
// Returns the NavigationHandle associated with the navigation being // Returns the NavigationHandle associated with the navigation being
// simulated. It is an error to call this before Start() or after the // simulated. It is an error to call this before Start() or after the
// navigation has finished (successfully or not). // navigation has finished (successfully or not).
virtual NavigationHandle* GetNavigationHandle() const = 0; virtual NavigationHandle* GetNavigationHandle() = 0;
// Returns the GlobalRequestID for the simulated navigation request. Can be // Returns the GlobalRequestID for the simulated navigation request. Can be
// invoked after the navigation has completed. It is an error to call this // invoked after the navigation has completed. It is an error to call this
// before the simulated navigation has completed its WillProcessResponse // before the simulated navigation has completed its WillProcessResponse
// callback. // callback.
virtual GlobalRequestID GetGlobalRequestID() const = 0; virtual GlobalRequestID GetGlobalRequestID() = 0;
private: private:
// This interface should only be implemented inside content. // This interface should only be implemented inside content.
......
...@@ -36,11 +36,11 @@ class TestWebUIDataSourceImpl : public TestWebUIDataSource { ...@@ -36,11 +36,11 @@ class TestWebUIDataSourceImpl : public TestWebUIDataSource {
~TestWebUIDataSourceImpl() override {} ~TestWebUIDataSourceImpl() override {}
const base::DictionaryValue* GetLocalizedStrings() const override { const base::DictionaryValue* GetLocalizedStrings() override {
return source_->GetLocalizedStrings(); return source_->GetLocalizedStrings();
} }
const ui::TemplateReplacements* GetReplacements() const override { const ui::TemplateReplacements* GetReplacements() override {
return source_->GetReplacements(); return source_->GetReplacements();
} }
......
...@@ -26,9 +26,9 @@ class TestWebUIDataSource { ...@@ -26,9 +26,9 @@ class TestWebUIDataSource {
virtual ~TestWebUIDataSource() = default; virtual ~TestWebUIDataSource() = default;
virtual const base::DictionaryValue* GetLocalizedStrings() const = 0; virtual const base::DictionaryValue* GetLocalizedStrings() = 0;
virtual const ui::TemplateReplacements* GetReplacements() const = 0; virtual const ui::TemplateReplacements* GetReplacements() = 0;
virtual WebUIDataSource* GetWebUIDataSource() = 0; virtual WebUIDataSource* GetWebUIDataSource() = 0;
}; };
......
...@@ -122,10 +122,10 @@ class WebContentsTester { ...@@ -122,10 +122,10 @@ class WebContentsTester {
// Returns headers that were passed in the previous SaveFrameWithHeaders(...) // Returns headers that were passed in the previous SaveFrameWithHeaders(...)
// call. // call.
virtual const std::string& GetSaveFrameHeaders() const = 0; virtual const std::string& GetSaveFrameHeaders() = 0;
// Returns the suggested file name passed in the SaveFrameWithHeaders call. // Returns the suggested file name passed in the SaveFrameWithHeaders call.
virtual const base::string16& GetSuggestedFileName() const = 0; virtual const base::string16& GetSuggestedFileName() = 0;
// Returns whether a download request triggered via DownloadImage() is in // Returns whether a download request triggered via DownloadImage() is in
// progress for |url|. // progress for |url|.
......
...@@ -914,12 +914,12 @@ NavigationSimulatorImpl::GetLastThrottleCheckResult() { ...@@ -914,12 +914,12 @@ NavigationSimulatorImpl::GetLastThrottleCheckResult() {
return last_throttle_check_result_.value(); return last_throttle_check_result_.value();
} }
NavigationHandleImpl* NavigationSimulatorImpl::GetNavigationHandle() const { NavigationHandleImpl* NavigationSimulatorImpl::GetNavigationHandle() {
CHECK_GE(state_, STARTED); CHECK_GE(state_, STARTED);
return request_->navigation_handle(); return request_->navigation_handle();
} }
content::GlobalRequestID NavigationSimulatorImpl::GetGlobalRequestID() const { content::GlobalRequestID NavigationSimulatorImpl::GetGlobalRequestID() {
CHECK_GT(state_, STARTED) << "The GlobalRequestID is not available until " CHECK_GT(state_, STARTED) << "The GlobalRequestID is not available until "
"after the navigation has completed " "after the navigation has completed "
"WillProcessResponse"; "WillProcessResponse";
......
...@@ -97,8 +97,8 @@ class NavigationSimulatorImpl : public NavigationSimulator, ...@@ -97,8 +97,8 @@ class NavigationSimulatorImpl : public NavigationSimulator,
void SetSSLInfo(const net::SSLInfo& ssl_info) override; void SetSSLInfo(const net::SSLInfo& ssl_info) override;
NavigationThrottle::ThrottleCheckResult GetLastThrottleCheckResult() override; NavigationThrottle::ThrottleCheckResult GetLastThrottleCheckResult() override;
NavigationHandleImpl* GetNavigationHandle() const override; NavigationHandleImpl* GetNavigationHandle() override;
content::GlobalRequestID GetGlobalRequestID() const override; content::GlobalRequestID GetGlobalRequestID() override;
// Additional utilites usable only inside content/. // Additional utilites usable only inside content/.
......
...@@ -190,11 +190,11 @@ void TestWebContents::TestDidNavigateWithSequenceNumber( ...@@ -190,11 +190,11 @@ void TestWebContents::TestDidNavigateWithSequenceNumber(
rfh->SendNavigateWithParams(&params, was_within_same_document); rfh->SendNavigateWithParams(&params, was_within_same_document);
} }
const std::string& TestWebContents::GetSaveFrameHeaders() const { const std::string& TestWebContents::GetSaveFrameHeaders() {
return save_frame_headers_; return save_frame_headers_;
} }
const base::string16& TestWebContents::GetSuggestedFileName() const { const base::string16& TestWebContents::GetSuggestedFileName() {
return suggested_filename_; return suggested_filename_;
} }
......
...@@ -95,8 +95,8 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { ...@@ -95,8 +95,8 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester {
NavigationHandle* navigation_handle, NavigationHandle* navigation_handle,
scoped_refptr<net::HttpResponseHeaders> response_headers) override; scoped_refptr<net::HttpResponseHeaders> response_headers) override;
void SetOpener(WebContents* opener) override; void SetOpener(WebContents* opener) override;
const std::string& GetSaveFrameHeaders() const override; const std::string& GetSaveFrameHeaders() override;
const base::string16& GetSuggestedFileName() const override; const base::string16& GetSuggestedFileName() override;
bool HasPendingDownloadImage(const GURL& url) override; bool HasPendingDownloadImage(const GURL& url) override;
bool TestDidDownloadImage( bool TestDidDownloadImage(
const GURL& url, const GURL& url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment