Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: build/android/update_verification.py

Issue 1571803002: [Android] Prepare build/android/ for catapult+devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-device-library-links
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/tombstones.py ('k') | build/android/video_recorder.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs semi-automated update testing on a non-rooted device. 7 """Runs semi-automated update testing on a non-rooted device.
8 8
9 This script will help verify that app data is preserved during an update. 9 This script will help verify that app data is preserved during an update.
10 To use this script first run it with the create_app_data option. 10 To use this script first run it with the create_app_data option.
(...skipping 10 matching lines...) Expand all
21 --app-data <path> 21 --app-data <path>
22 22
23 This will install the old apk, load the saved app data, install the new apk, 23 This will install the old apk, load the saved app data, install the new apk,
24 and ask the user to verify that all of the app data was preserved. 24 and ask the user to verify that all of the app data was preserved.
25 """ 25 """
26 26
27 import argparse 27 import argparse
28 import logging 28 import logging
29 import sys 29 import sys
30 30
31 import devil_chromium
32
31 from devil.android import apk_helper 33 from devil.android import apk_helper
32 from devil.android import device_blacklist 34 from devil.android import device_blacklist
33 from devil.android import device_errors 35 from devil.android import device_errors
34 from devil.android import device_utils 36 from devil.android import device_utils
35 from devil.utils import run_tests_helper 37 from devil.utils import run_tests_helper
36 38
37 def CreateAppData(device, old_apk, app_data, package_name): 39 def CreateAppData(device, old_apk, app_data, package_name):
38 device.Install(old_apk) 40 device.Install(old_apk)
39 raw_input('Set the application state. Once ready, press enter and ' 41 raw_input('Set the application state. Once ready, press enter and '
40 'select "Backup my data" on the device.') 42 'select "Backup my data" on the device.')
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 subparser.add_argument('--new-apk', required=True, 82 subparser.add_argument('--new-apk', required=True,
81 help='Path to apk to update to.') 83 help='Path to apk to update to.')
82 subparser.add_argument('--app-data', required=True, 84 subparser.add_argument('--app-data', required=True,
83 help='Path to where the app data backup is saved.') 85 help='Path to where the app data backup is saved.')
84 subparser.add_argument('--package-name', 86 subparser.add_argument('--package-name',
85 help='Chrome apk package name.') 87 help='Chrome apk package name.')
86 88
87 args = parser.parse_args() 89 args = parser.parse_args()
88 run_tests_helper.SetLogLevel(args.verbose) 90 run_tests_helper.SetLogLevel(args.verbose)
89 91
92 devil_chromium.Initialize()
93
90 blacklist = (device_blacklist.Blacklist(args.blacklist_file) 94 blacklist = (device_blacklist.Blacklist(args.blacklist_file)
91 if args.blacklist_file 95 if args.blacklist_file
92 else None) 96 else None)
93 97
94 devices = device_utils.DeviceUtils.HealthyDevices(blacklist) 98 devices = device_utils.DeviceUtils.HealthyDevices(blacklist)
95 if not devices: 99 if not devices:
96 raise device_errors.NoDevicesError() 100 raise device_errors.NoDevicesError()
97 device = devices[0] 101 device = devices[0]
98 logging.info('Using device %s for testing.', str(device)) 102 logging.info('Using device %s for testing.', str(device))
99 103
100 package_name = (args.package_name if args.package_name 104 package_name = (args.package_name if args.package_name
101 else apk_helper.GetPackageName(args.old_apk)) 105 else apk_helper.GetPackageName(args.old_apk))
102 if args.command == 'create_app_data': 106 if args.command == 'create_app_data':
103 CreateAppData(device, args.old_apk, args.app_data, package_name) 107 CreateAppData(device, args.old_apk, args.app_data, package_name)
104 elif args.command == 'test_update': 108 elif args.command == 'test_update':
105 TestUpdate( 109 TestUpdate(
106 device, args.old_apk, args.new_apk, args.app_data, package_name) 110 device, args.old_apk, args.new_apk, args.app_data, package_name)
107 else: 111 else:
108 raise Exception('Unknown test command: %s' % args.command) 112 raise Exception('Unknown test command: %s' % args.command)
109 113
110 if __name__ == '__main__': 114 if __name__ == '__main__':
111 sys.exit(main()) 115 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/tombstones.py ('k') | build/android/video_recorder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698