summaryrefslogtreecommitdiffstats
path: root/android_webview/javatests
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:29:06 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:29:06 +0000
commitf58731ed52d36df88ba4ab11fc2dc8457fcbc3e0 (patch)
tree06be43b89b263998dffde08f2a01696ec9d9df3b /android_webview/javatests
parentb4aef95883fec95e5c08d1e36d8c60af84bd86dc (diff)
downloadchromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.zip
chromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.tar.gz
chromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.tar.bz2
Extend WebView useragent to mention Chrome version.
Add "Chrome/XX.0.0.0" to the WebView's useragent to hint to servers that the rendering engine is a modern Chromium and therefore it's okay to serve "good" content to it. We keep the existing "Version/4.0" token in case WebView-specific content is sniffing for it. The generic version 33.0.0.0 is used as the version of Chromium in the WebView does not correspond to any exact Chromium branch and trunk is currently designated as M33. Bug: 10659017 Change-Id: I5c80509955ffb491f07b48cc5a0b0023ceb368a3 BUG=297522 NOTRY=true Review URL: https://codereview.chromium.org/86843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/javatests')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
index d2ced4e..c3d575d 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
@@ -1504,10 +1504,12 @@ public class AwSettingsTest extends AwTestBase {
final AwContents awContents = testContainerView.getAwContents();
AwSettings settings = getAwSettingsOnUiThread(awContents);
final String actualUserAgentString = settings.getUserAgentString();
+ assertEquals(actualUserAgentString, AwSettings.getDefaultUserAgent());
final String patternString =
"Mozilla/5\\.0 \\(Linux;( U;)? Android ([^;]+);( (\\w+)-(\\w+);)?" +
"\\s?(.*)\\sBuild/(.+)\\) AppleWebKit/(\\d+)\\.(\\d+) \\(KHTML, like Gecko\\) " +
- "Version/\\d+\\.\\d+( Mobile)? Safari/(\\d+)\\.(\\d+)";
+ "Version/\\d+\\.\\d Chrome/\\d+\\.\\d+\\.\\d+\\.\\d+" +
+ "( Mobile)? Safari/(\\d+)\\.(\\d+)";
final Pattern userAgentExpr = Pattern.compile(patternString);
Matcher patternMatcher = userAgentExpr.matcher(actualUserAgentString);
assertTrue(String.format("User agent string did not match expected pattern. %nExpected " +