Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: ios/web/web_state/web_state_impl_unittest.mm

Issue 1891483005: [ios] Added API to enable/disable web usage for WebState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ios/web/shell/DEPS ('K') | « ios/web/web_state/web_state_impl.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl_unittest.mm
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm
index 8091d54a479deea14227f93eeebea7724fb9af20..9745c65b246e66a10522d91dd8a895ddc3bf397a 100644
--- a/ios/web/web_state/web_state_impl_unittest.mm
+++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -282,6 +282,19 @@ class WebStateTest : public web::WebTest {
std::unique_ptr<WebStateImpl> web_state_;
};
+TEST_F(WebStateTest, WebUsageEnabled) {
+ // Default is false.
+ ASSERT_FALSE(web_state_->IsWebUsageEnabled());
+
+ web_state_->SetWebUsageEnabled(true);
+ EXPECT_TRUE(web_state_->IsWebUsageEnabled());
+ EXPECT_TRUE(web_state_->GetWebController().webUsageEnabled);
+
+ web_state_->SetWebUsageEnabled(false);
+ EXPECT_FALSE(web_state_->IsWebUsageEnabled());
+ EXPECT_FALSE(web_state_->GetWebController().webUsageEnabled);
+}
+
TEST_F(WebStateTest, ResponseHeaders) {
GURL real_url("http://foo.com/bar");
GURL frame_url("http://frames-r-us.com/");
« ios/web/shell/DEPS ('K') | « ios/web/web_state/web_state_impl.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698