summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorgkanwar@chromium.org <gkanwar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 18:09:37 +0000
committergkanwar@chromium.org <gkanwar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 18:09:37 +0000
commitf3da04f7be479e17be39e466b6afb9f7de63fe44 (patch)
tree56524f284196e118475df134d8db7e93c128b1e1 /build
parent67954f82d54c9e90c8668834e75853465d3493d3 (diff)
downloadchromium_src-f3da04f7be479e17be39e466b6afb9f7de63fe44.zip
chromium_src-f3da04f7be479e17be39e466b6afb9f7de63fe44.tar.gz
chromium_src-f3da04f7be479e17be39e466b6afb9f7de63fe44.tar.bz2
[Android] Removes run_* scripts, moves run_update_verificaiton
NOTRY=True BUG=223650 Review URL: https://chromiumcodereview.appspot.com/23106004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/all_android.gyp4
-rwxr-xr-xbuild/android/run_browser_tests.py23
-rwxr-xr-xbuild/android/run_instrumentation_tests.py23
-rwxr-xr-xbuild/android/run_tests.py23
-rwxr-xr-xbuild/android/run_uiautomator_tests.py24
-rwxr-xr-xbuild/android/run_update_verification.py135
6 files changed, 2 insertions, 230 deletions
diff --git a/build/all_android.gyp b/build/all_android.gyp
index 0296580..2e3711e 100644
--- a/build/all_android.gyp
+++ b/build/all_android.gyp
@@ -40,8 +40,8 @@
{
# The current list of tests for android. This is temporary
# until the full set supported. If adding a new test here,
- # please also add it to build/android/run_tests.py, else the
- # test is not run.
+ # please also add it to build/android/pylib/gtest/gtest_config.py,
+ # else the test is not run.
#
# WARNING:
# Do not add targets here without communicating the implications
diff --git a/build/android/run_browser_tests.py b/build/android/run_browser_tests.py
deleted file mode 100755
index c536a29..0000000
--- a/build/android/run_browser_tests.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs content_browsertests."""
-
-import logging
-import os
-import sys
-
-from pylib import cmd_helper
-
-
-if __name__ == '__main__':
- args = [os.path.join(os.path.dirname(__file__), 'test_runner.py'),
- 'gtest', '-s', 'content_browsertests'] + sys.argv[1:]
- logging.warning('*' * 80)
- logging.warning('This script is deprecated and will be removed soon.')
- logging.warning('Use the following instead: %s', ' '.join(args))
- logging.warning('*' * 80)
- sys.exit(1)
diff --git a/build/android/run_instrumentation_tests.py b/build/android/run_instrumentation_tests.py
deleted file mode 100755
index 7a9fa1e..0000000
--- a/build/android/run_instrumentation_tests.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs both the Python and Java instrumentation tests."""
-
-import logging
-import os
-import sys
-
-from pylib import cmd_helper
-
-
-if __name__ == '__main__':
- args = [os.path.join(os.path.dirname(__file__), 'test_runner.py'),
- 'instrumentation'] + sys.argv[1:]
- logging.warning('*' * 80)
- logging.warning('This script is deprecated and will be removed soon.')
- logging.warning('Use the following instead: %s', ' '.join(args))
- logging.warning('*' * 80)
- sys.exit(1)
diff --git a/build/android/run_tests.py b/build/android/run_tests.py
deleted file mode 100755
index 59118cf..0000000
--- a/build/android/run_tests.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs all the native unit tests."""
-
-import logging
-import os
-import sys
-
-from pylib import cmd_helper
-
-
-if __name__ == '__main__':
- args = [os.path.join(os.path.dirname(__file__), 'test_runner.py'),
- 'gtest'] + sys.argv[1:]
- logging.warning('*' * 80)
- logging.warning('This script is deprecated and will be removed soon.')
- logging.warning('Use the following instead: %s', ' '.join(args))
- logging.warning('*' * 80)
- sys.exit(1)
diff --git a/build/android/run_uiautomator_tests.py b/build/android/run_uiautomator_tests.py
deleted file mode 100755
index 4a94a83..0000000
--- a/build/android/run_uiautomator_tests.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs both the Python and Java UIAutomator tests."""
-
-import logging
-import os
-import sys
-
-from pylib import cmd_helper
-
-
-if __name__ == '__main__':
- args = ['python',
- os.path.join(os.path.dirname(__file__), 'test_runner.py'),
- 'uiautomator'] + sys.argv[1:]
- logging.warning('*' * 80)
- logging.warning('This script is deprecated and will be removed soon.')
- logging.warning('Use the following instead: %s', ' '.join(args))
- logging.warning('*' * 80)
- sys.exit(cmd_helper.RunCmd(args))
diff --git a/build/android/run_update_verification.py b/build/android/run_update_verification.py
deleted file mode 100755
index 5f62f3e..0000000
--- a/build/android/run_update_verification.py
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs semi-automated update testing on a non-rooted device."""
-import logging
-import optparse
-import os
-import shutil
-import sys
-import time
-
-from pylib import android_commands
-
-
-def _SaveAppData(adb, package_name, from_apk=None, data_dir=None):
- def _BackupAppData(data_dir=None):
- adb.Adb().SendCommand('backup %s' % package_name)
- backup_file = os.path.join(os.getcwd(), 'backup.ab')
- assert os.path.exists(backup_file), 'Backup failed.'
- if data_dir:
- if not os.path.isdir(data_dir):
- os.makedirs(data_dir)
- shutil.move(backup_file, data_dir)
- backup_file = os.path.join(data_dir, 'backup.ab')
- print 'Application data saved to %s' % backup_file
-
- if from_apk:
- logging.info('Installing %s...', from_apk)
- output = adb.Install(from_apk, reinstall=True)
- if 'Success' not in output:
- raise Exception('Unable to install %s. output: %s' % (from_apk, output))
-
- raw_input('Set the application state. Once ready, press enter and '
- 'select "Backup my data" on the device.')
- _BackupAppData(data_dir)
-
-
-def _VerifyAppUpdate(adb, to_apk, app_data, from_apk=None):
- def _RestoreAppData():
- assert os.path.exists(app_data), 'Backup file does not exist!'
- adb.Adb().SendCommand('restore %s' % app_data)
- # It seems restore command is not synchronous.
- time.sleep(15)
-
- if from_apk:
- logging.info('Installing %s...', from_apk)
- output = adb.Install(from_apk, reinstall=True)
- if 'Success' not in output:
- raise Exception('Unable to install %s. output: %s' % (from_apk, output))
-
- logging.info('Restoring the application data...')
- raw_input('Press enter and select "Restore my data" on the device.')
- _RestoreAppData()
-
- logging.info('Verifying that %s cannot be installed side-by-side...',
- to_apk)
- output = adb.Install(to_apk)
- if 'INSTALL_FAILED_ALREADY_EXISTS' not in output:
- if 'Success' in output:
- raise Exception('Package name has changed! output: %s' % output)
- else:
- raise Exception(output)
-
- logging.info('Verifying that %s can be overinstalled...', to_apk)
- output = adb.Install(to_apk, reinstall=True)
- if 'Success' not in output:
- raise Exception('Unable to install %s.\n output: %s' % (to_apk, output))
- logging.info('Successfully updated to the new apk. Please verify that the '
- 'the application data is preserved.')
-
-
-def main():
- logger = logging.getLogger()
- logger.setLevel(logging.DEBUG)
- desc = (
- 'Performs semi-automated application update verification testing. '
- 'When given --save, it takes a snapshot of the application data '
- 'on the device. (A dialog on the device will prompt the user to grant '
- 'permission to backup the data.) Otherwise, it performs the update '
- 'testing as follows: '
- '1. Installs the |from-apk| (optional). '
- '2. Restores the previously stored snapshot of application data '
- 'given by |app-data| '
- '(A dialog on the device will prompt the user to grant permission to '
- 'restore the data.) '
- '3. Verifies that |to-apk| cannot be installed side-by-side. '
- '4. Verifies that |to-apk| can replace |from-apk|.')
- parser = optparse.OptionParser(description=desc)
- parser.add_option('--package-name', help='Package name for the application.')
- parser.add_option('--save', action='store_true',
- help=('Save a snapshot of application data. '
- 'This will be saved as backup.db in the '
- 'current directory if |app-data| directory '
- 'is not specifid.'))
- parser.add_option('--from-apk',
- help=('APK to update from. This is optional if you already '
- 'have the app installed.'))
- parser.add_option('--to-apk', help='APK to update to.')
- parser.add_option('--app-data',
- help=('Path to the application data to be restored or the '
- 'directory where the data should be saved.'))
- (options, args) = parser.parse_args()
-
- if args:
- parser.print_help(sys.stderr)
- parser.error('Unknown arguments: %s.' % args)
-
- if len(android_commands.GetAttachedDevices()) != 1:
- parser.error('Exactly 1 device must be attached.')
- adb = android_commands.AndroidCommands()
-
- if options.from_apk:
- assert os.path.isfile(options.from_apk)
-
- if options.save:
- if not options.package_name:
- parser.print_help(sys.stderr)
- parser.error('Missing --package-name.')
- _SaveAppData(adb, options.package_name, from_apk=options.from_apk,
- data_dir=options.app_data)
- else:
- if not options.to_apk or not options.app_data:
- parser.print_help(sys.stderr)
- parser.error('Missing --to-apk or --app-data.')
- assert os.path.isfile(options.to_apk)
- assert os.path.isfile(options.app_data)
- _VerifyAppUpdate(adb, options.to_apk, options.app_data,
- from_apk=options.from_apk)
-
-
-if __name__ == '__main__':
- main()