Commit d681a009 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

Android: switch to device.IsApplicationInstalled

No change to logic. This switches to the new
device.IsApplicationInstalled() where it helps code readability.

Bug: 1002774
Test: Manual - try the scripts
Change-Id: I514310922e2453ff887028006e7d97939de81139
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808586
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697254}
parent f83e22aa
......@@ -74,11 +74,10 @@ def UninstallWebViewUpdates(device):
def CheckWebViewIsUninstalled(device):
"""Throws if WebView is still installed."""
for webview_package in WEBVIEW_PACKAGES:
paths = device.GetApplicationPaths(webview_package)
if paths:
if device.IsApplicationInstalled(webview_package):
raise device_errors.CommandFailedError(
'{} is still installed on the device at {}'.format(
webview_package, paths), device)
'{} is still installed on the device'.format(webview_package),
device)
def RemovePreinstalledWebViews(device):
......
......@@ -49,8 +49,7 @@ def TestUpdate(device, old_apk, new_apk, app_data, package_name):
# Restore command is not synchronous
raw_input('Select "Restore my data" on the device. Then press enter to '
'continue.')
device_path = device.GetApplicationPaths(package_name)
if not device_path:
if not device.IsApplicationInstalled(package_name):
raise Exception('Expected package %s to already be installed. '
'Package name might have changed!' % package_name)
......
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