Commit ad756a88 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix ChromeWebClientTest on iOS 12

The DefaultUserAgent is only enabled for iOS 13. This CL updates the
tests to reflect that.

Fixed: 1073875
Change-Id: I9ad4490d80baad68cdbfeddd675d4105b989ad06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2162749Reviewed-by: default avatarRobbie Gibson <rkgibson@google.com>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761924}
parent 79d284b8
......@@ -324,6 +324,11 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) {
// Tests the default user agent for different views.
TEST_F(ChromeWebClientTest, DefaultUserAgent) {
if (@available(iOS 13, *)) {
} else {
// The feature is only available on iOS 13.
return;
}
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures(
{web::features::kUseDefaultUserAgentInWebClient, web::kMobileGoogleSRP},
......@@ -373,6 +378,7 @@ TEST_F(ChromeWebClientTest, DefaultUserAgent) {
EXPECT_EQ(web::UserAgentType::DESKTOP,
web_client.GetDefaultUserAgent(mock_regular_regular_view,
non_google_url));
EXPECT_EQ(
web::UserAgentType::MOBILE,
web_client.GetDefaultUserAgent(mock_regular_regular_view, google_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