Commit dc3de3ce authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android WebAPK] Remove support for Chromium browsers with version "Developer Build" 6/X

http://crbug.com/866739 changed local Chromium builds to use a real "version name"
instead of "Developer Build".
WebAPKs determine whether a candidate host browser is WebAPK-compatible based on
the host browser's version-name. This CL removes the special case logic for
browsers with version-name "Developer Build".

BUG=817263

Change-Id: I0b92e78adb2e57128ee958e8b12f61c196c6c874
Reviewed-on: https://chromium-review.googlesource.com/1244360Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594440}
parent 95470702
...@@ -221,26 +221,6 @@ public final class MainActivityTest { ...@@ -221,26 +221,6 @@ public final class MainActivityTest {
assertWebApkLaunched(startUrl); assertWebApkLaunched(startUrl);
} }
/** Tests that a WebAPK should not be launched as a tab in a developer build of Chrome. */
@Test
public void testShouldNotLaunchInTabWithDevBuild() throws Exception {
final String startUrl = "https://www.google.com/";
final String devVersionName = "Developer Build";
Bundle bundle = new Bundle();
bundle.putString(WebApkMetaDataKeys.START_URL, startUrl);
bundle.putString(WebApkMetaDataKeys.SCOPE, startUrl);
bundle.putString(WebApkMetaDataKeys.RUNTIME_HOST, BROWSER_PACKAGE_NAME);
WebApkTestHelper.registerWebApkWithMetaData(WebApkUtilsTest.WEBAPK_PACKAGE_NAME, bundle);
mPackageManager.getPackageInfo(BROWSER_PACKAGE_NAME, 0).versionName = devVersionName;
Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(startUrl));
Robolectric.buildActivity(MainActivity.class, launchIntent).create();
assertWebApkLaunched(startUrl);
}
/** Asserts that {@link BROWSER_PACKAGE_NAME} was launched in WebAPK mode. */ /** Asserts that {@link BROWSER_PACKAGE_NAME} was launched in WebAPK mode. */
private void assertWebApkLaunched(String expectedStartUrl) { private void assertWebApkLaunched(String expectedStartUrl) {
Intent startActivityIntent = ShadowApplication.getInstance().getNextStartedActivity(); Intent startActivityIntent = ShadowApplication.getInstance().getNextStartedActivity();
...@@ -270,7 +250,7 @@ public final class MainActivityTest { ...@@ -270,7 +250,7 @@ public final class MainActivityTest {
private static PackageInfo newPackageInfo(String packageName) { private static PackageInfo newPackageInfo(String packageName) {
PackageInfo packageInfo = new PackageInfo(); PackageInfo packageInfo = new PackageInfo();
packageInfo.packageName = packageName; packageInfo.packageName = packageName;
packageInfo.versionName = "Developer Build"; packageInfo.versionName = "10000.0.0.0";
packageInfo.applicationInfo = new ApplicationInfo(); packageInfo.applicationInfo = new ApplicationInfo();
packageInfo.applicationInfo.enabled = true; packageInfo.applicationInfo.enabled = true;
return packageInfo; return packageInfo;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# (including AndroidManifest.xml) is updated. This version should be incremented # (including AndroidManifest.xml) is updated. This version should be incremented
# prior to uploading a new ShellAPK to the WebAPK Minting Server. # prior to uploading a new ShellAPK to the WebAPK Minting Server.
# Does not affect Chrome.apk # Does not affect Chrome.apk
template_shell_apk_version = 54 template_shell_apk_version = 55
# The ShellAPK version expected by Chrome. Chrome will try to update the WebAPK # The ShellAPK version expected by Chrome. Chrome will try to update the WebAPK
# if the WebAPK's ShellAPK version is less than |expected_shell_apk_version|. # if the WebAPK's ShellAPK version is less than |expected_shell_apk_version|.
......
...@@ -31,9 +31,6 @@ public class HostBrowserUtils { ...@@ -31,9 +31,6 @@ public class HostBrowserUtils {
private static final int MINIMUM_REQUIRED_CHROME_VERSION = 57; private static final int MINIMUM_REQUIRED_CHROME_VERSION = 57;
/** Version name for developer builds. */
private static final String DEVELOPER_BUILD_VERSION_NAME = "Developer Build";
private static final String TAG = "cr_HostBrowserUtils"; private static final String TAG = "cr_HostBrowserUtils";
/** /**
...@@ -222,9 +219,6 @@ public class HostBrowserUtils { ...@@ -222,9 +219,6 @@ public class HostBrowserUtils {
String versionName = info.versionName; String versionName = info.versionName;
int dotIndex = versionName.indexOf("."); int dotIndex = versionName.indexOf(".");
if (dotIndex < 0) { if (dotIndex < 0) {
if (DEVELOPER_BUILD_VERSION_NAME.equals(versionName)) {
return MINIMUM_REQUIRED_CHROME_VERSION;
}
return -1; return -1;
} }
try { try {
......
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