summaryrefslogtreecommitdiff
path: root/test-runner/src/android/test/InstrumentationTestRunner.java
AgeCommit message (Collapse)Author
2020-06-25Don't use impl lib of android.test.[mock|base|runners]Jiyong Park
The java_sdk_library modules are now added with 'default_to_stubs: true' so that their impl libraries are not used even when the clients don't have sdk_version property set. This will allow us to replace the direct references to the stub libraries of the java_sdk_library modules with the references to the modules themselves (e.g. android.test.base.stubs -> android.test.base) in many of the CTS tests without unintentionally exposing the private APIs in the impl lib. As part of the change, MockContentProvider.getIContentProviderBinder() now returns an anonymous Binder object instead of throwing an exception. This is to eliminate the need for clients to override the now inaccessible method to escape from the exception. Also, InstrumentationTestRunner.addTestListener method is added to the stub because it is used by several tests (MtpServiceTests, etc.) Bug: 157007292 Test: m Change-Id: I14cf217f21fd3534c920c3a6336cf2d14c02e60c
2017-06-26Merge "Clean up Predicate related code in android.test" into ↵Paul Duffin
oc-dev-plus-aosp am: 50826c5f2e am: 4f9d89a380 Change-Id: I24b978bb63875ed7e1af7041f8ecbbfc482e0614
2017-06-22Clean up Predicate related code in android.testPaul Duffin
Part of the work of removing JUnit and dependent android.test classes from the Android API involves providing a static library that developers can include in their test applications to ease migration. That library will be built directly from the source (as opposed to android.jar which is built from stubs) and so developers will be able to see classes and methods that are not present in the stubs. This change is one of a number of similar changes that cleanup the existing non-API code in order to minimize the additional methods and classes exposed externally. The basic approach is to remove unused classes and methods, use least visible access modifier possible and generally minimize the amount of publicly visible code. The HasClassAnnotation and HasMethodAnnotation were never used separately and only used by HasAnnotation. This merges the functionality into a single nested class in TestPredicates, hidden behind the new TestPredicates.hasAnnotation(). The HasAnnotationTest was renamed as TestPredicatesTest and the HasClassAnnotationTest and HasMethodAnnotationTest classes were removed as their tests provide no additional coverage. The removal of the Has*Annotation.java files means that the test-runner/src/android/test/suitebuilder/annotation/ directory is empty apart from the package.html file so that was moved to legacy-test to sit alongside the actual annotation classes. The Predicates class, while part of the legacy-test module was only ever used by the test-runner module and only its not() method was actually used. So, the not() method and associated nested class were moved to TestPredicates, the tests for not() were moved to TestPredicatesTest and the Predicates* classes were removed. That allowed for the removal of the legacy-android-tests as that is now empty. TestPredicates has a number of constants that were public. They were hidden by moving them to the class that actually used them. A minor generic issue was fixed in AssignableFrom. Bug: 30188076 Test: make checkbuild and run FrameworkTestRunnerTests Change-Id: I861da388a4146bb28e1e480d1b7ba9137b7b270e
2017-06-21Merge "Remove android.test dependencies on a.o.PerformanceCollector"Paul Duffin
2017-06-20Cleanup a.t.InstrumentationTestRunnerPaul Duffin
ARGUMENT_TEST_CLASS, ARGUMENT_TEST_PACKAGE, ARGUMENT_TEST_SIZE_PREDICATE and ARGUMENT_DELAY_MSEC were made package private because they are not part of the API and are only used from within the same package. The JavaDoc comment was changed to a multi-line comment because it is not and should not be associated with any member. Fixed a couple of minor JavaDoc issues. Bug: 30188076 Test: make checkbuild Change-Id: If28460aec2fd0080e0f5346a83abae393b7a9fb2
2017-06-20Remove android.test dependencies on a.o.PerformanceCollectorPaul Duffin
The a.t.TimedTest annotation was removed because it was not in the API and was only used by the code that has been removed. The a.t.PerformanceCollectorTestCase was removed because it was not in the API and its only purpose was to allow the AndroidTestRunner to supply a PerformanceCollector.PerformanceResultsWriter to a test. Bug: 62652137 Test: make checkbuild Change-Id: Ie90a7004ade1448cb6bc7e029f6ba5620db29bfd
2016-01-27Deprecated platform Android testing APIsStephan Linzner
- Deprecated most android.test.* APIs - Kept ProviderTestCase2 and LoaderTestCase since we don't have a replacement yet - Deprecated android.test.suitebuilder - Added Javadoc to all deprecated APIs with links to corresponding Android Testing Support Library APIs - Removed all trailing whitespace Bug: 22314304 Change-Id: I1b1f0dd5132364110f1dfd4e3eb2dd044700d859
2014-01-14docs: Fixed typo in InstrumentationTestRunner page.quddusc
Bug: 11386360 Change-Id: I7626fe6fe1a22e223a8929ed3e5178c8df8966c9
2013-01-28Fixing the buildSvetoslav
Change-Id: Ief7654775307c829a60e65217ae821aa6801303c
2013-01-22Adding UI test automation APIs.Svetoslav Ganov
This change adds APIs support for implementing UI tests. Such tests do not rely on internal application structure and can span across application boundaries. UI automation APIs are encapsulated in the UiAutomation object that is provided by an Instrumentation object. It is initialized by the system and can be used for both introspecting the screen and performing interactions simulating a user. UI test are normal instrumentation tests and are executed on the device. UiAutomation uses the accessibility APIs to introspect the screen and a special delegate object to perform privileged operations such as injecting input events. Since instrumentation tests are invoked by a shell command, the shell program launching the tests creates a delegate object and passes it as an argument to started instrumentation. This delegate allows the APK that runs the tests to access some privileged operations protected by a signature level permissions which are explicitly granted to the shell user. The UiAutomation object also supports running tests in the legacy way where the tests are run as a Java shell program. This enables existing UiAutomator tests to keep working while the new ones should be implemented using the new APIs. The UiAutomation object exposes lower level APIs which allow simulation of arbitrary user interactions and writing complete UI test cases. Clients, such as UiAutomator, are encouraged to implement higher- level APIs which minimize development effort and can be used as a helper library by the test developer. The benefit of this change is decoupling UiAutomator from the system since the former was calling hidden APIs which required that it is bundled in the system image. This prevented UiAutomator from being evolved separately from the system. Also UiAutomator was creating additional API surface in the system image. Another benefit of the new design is that now test cases have access to a context and can use public platform APIs in addition to the UiAutomator ones. Further, third-parties can develop their own higher level test APIs on top of the lower level ones exposes by UiAutomation. bug:8028258 Also this change adds the fully qualified resource name of the view's id in the emitted AccessibilityNodeInfo if a special flag is set while configuring the accessibility service. Also added is API for looking up node infos by this id. The id resource name is relatively more stable compared to the generaed id number which may change from one build to another. This API facilitate reuing the already defined ids for UI automation. bug:7678973 Change-Id: I589ad14790320dec8a33095953926c2a2dd0228b
2012-10-24Remove erroneous override of package-private method.Brett Chabot
Change-Id: I8d473c1eb32f2513d01b3f7f14f0001286a6a9ca
2012-01-05Merge "BandwidthTestRunner"David Hu
2011-12-22docs: Add developer guide cross-references, Project ACRE, round 4Joe Fernandez
Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
2011-12-14BandwidthTestRunnerDavid Hu
Added BandwidthTest annotation and BandwidthTestRunner to start and stop the network traffic profiler Change-Id: Id29ac21ab99ff36bd864121276db59b61eb6e154
2011-09-19Return the bundle objectDavid Hu
Added the ability for the test runner to return the bundle object so the tests can get access to input arguments Change-Id: I73a704bb2279238bd91a376aacecbe5f607af649
2010-12-21Remove an obsolete import for performance tests.Jesse Wilson
Change-Id: Ifc76ef821f71ea7469b4044b15071f5d2a7418fd
2010-12-21Remove unused performance tests.Jesse Wilson
Change-Id: I5a252e314831716f99ce5fbb32d983c7473ee787
2010-11-17Fix NPE in InstrumentationTestRunnerBrian Muramatsu
This fixes a problem where the test runner would die when a test case has tests that are not methods of the test class. Change-Id: I5adc464bb4a0c8d282428895e422a47dcb6bfe1f
2010-10-19Added RepetitiveTest annotation and test runner supportJack Wang
Change-Id: I7bf0871ede6dd69512c6b6ea3484693ba5b78e89
2010-07-07Improve InstrumentationTestRunner exception handling.Brett Chabot
This commit fixes two somewhat related problems: - Attempting to run a method which does not exist caused a runtime exception which stopped the test run. Change this so the runner reports an individual test failure instead - A runtime exception during the test run would cause it to stop completely, with no information dumped to the logcat or stdout. Now exceptions are trapped and reported to stdout. Also added associated unit tests to test these two conditions. Related bug 2812262. Change-Id: I383f9b9bad99f14cb51071800fa9bdbf6a6a1119
2010-03-19Add -e package description to InstrumentationTestRunner javadoc.Brett Chabot
Bug 2528316 Change-Id: Ic707115e40a18521e0d57ee12f43df96be7033f2
2010-02-23fix error in javadocDoug Zongker
The "@link LargeTest" is broken since it doesn't know where that class is. Change-Id: Ie15e40bac8a1965427e351926b2208775e79cb13
2010-02-22Add ability to run tests restricted to given annotation.Brett Chabot
And ability to exclude tests with given annotation. Also fix class cast compile warning in emma output method. Bug 2239240 Change-Id: I56273a51a8c58a690680bdb612615fab69e6e13f
2010-02-20Fix code coverage output message when running tests in non-raw mode.Brett Chabot
Bug 2082804
2010-02-20Retry test-runner tests move.Brett Chabot
This time change the frameworks makefile so it only includes test-runner/src in the public API.
2010-02-19Revert "Move framework test-runner unit tests to be closer to their source."Brett Chabot
This reverts commit 12093976a4842a795491cfd2b1d3b71e18503f2d.
2010-02-19Move framework test-runner unit tests to be closer to their source.Brett Chabot
Move the test-runner source into a separate src folder to accommodate the test move.