Commit 49a2d618 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

startup_mobile.py: Use VIEW intents

In pinpoint jobs I noticed the StartupTabPreloader optimizations are not
triggering when they should, see:
https://pinpoint-dot-chromeperf.appspot.com/job/10b357bac20000

This appears to be because the Intent's component is
org.chromium.chrome.browser.ChromeTabbedActivity but the StartupTabPreloader expects
com.google.android.apps.chrome.Main and is ignoring the intent as a result.

By using a VIEW intent this optimization should trigger, which will
let us correctly evaluate some possible optimizations.

Bug: 1013535
Change-Id: Ifdd92faec33f7af2231746110a9ae10135ce8e21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864678Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706826}
parent 537552db
......@@ -127,7 +127,8 @@ class _MobileStartupSharedState(story_module.SharedState):
self.platform.StartActivity(
intent.Intent(package=self._possible_browser.settings.package,
activity=self._possible_browser.settings.activity,
action=None, data=url),
data=url,
action='android.intent.action.VIEW'),
blocking=True)
def LaunchCCT(self, url):
......@@ -140,20 +141,21 @@ class _MobileStartupSharedState(story_module.SharedState):
self.platform.StartActivity(
intent.Intent(package=self._possible_browser.settings.package,
activity=self._possible_browser.settings.activity,
action=None, data=url, extras=cct_extras),
data=url, extras=cct_extras,
action='android.intent.action.VIEW'),
blocking=True)
def LaunchMapsPwa(self):
# Launches a bound webapk. The APK should be installed by the shared state
# constructor. Upon launch, Chrome extracts the icon and the URL from the
# APK.
self.platform.WaitForBatteryTemperature(_MAX_BATTERY_TEMP)
self.platform.StartActivity(
intent.Intent(package='org.chromium.maps_go_webapk',
activity='org.chromium.webapk.shell_apk.MainActivity',
category='android.intent.category.LAUNCHER',
action='android.intent.action.MAIN'),
blocking=True)
self.platform.WaitForBatteryTemperature(_MAX_BATTERY_TEMP)
@contextlib.contextmanager
def FindBrowser(self):
......
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