diff options
Diffstat (limited to 'ios/web/public')
| -rw-r--r-- | ios/web/public/test/test_browser_state.cc | 9 | ||||
| -rw-r--r-- | ios/web/public/test/test_browser_state.h | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ios/web/public/test/test_browser_state.cc b/ios/web/public/test/test_browser_state.cc index 35f958a..d001bc3 100644 --- a/ios/web/public/test/test_browser_state.cc +++ b/ios/web/public/test/test_browser_state.cc @@ -34,14 +34,13 @@ class TestContextURLRequestContextGetter : public net::URLRequestContextGetter { } // namespace namespace web { -TestBrowserState::TestBrowserState() { -} +TestBrowserState::TestBrowserState() : is_off_the_record_(false) {} TestBrowserState::~TestBrowserState() { } bool TestBrowserState::IsOffTheRecord() const { - return false; + return is_off_the_record_; } base::FilePath TestBrowserState::GetStatePath() const { @@ -54,4 +53,8 @@ net::URLRequestContextGetter* TestBrowserState::GetRequestContext() { return request_context_.get(); } +void TestBrowserState::SetOffTheRecord(bool flag) { + is_off_the_record_ = flag; +} + } // namespace web diff --git a/ios/web/public/test/test_browser_state.h b/ios/web/public/test/test_browser_state.h index 841e191..8935041 100644 --- a/ios/web/public/test/test_browser_state.h +++ b/ios/web/public/test/test_browser_state.h @@ -19,8 +19,12 @@ class TestBrowserState : public BrowserState { base::FilePath GetStatePath() const override; net::URLRequestContextGetter* GetRequestContext() override; + // Makes |IsOffTheRecord| return the given flag value. + void SetOffTheRecord(bool flag); + private: scoped_refptr<net::URLRequestContextGetter> request_context_; + bool is_off_the_record_; }; } // namespace web |
