35 Commits

Author SHA1 Message Date
Louis Chang
f0385c5ad3 Fix WmTests presubmit failure
Adding another library that excludes mockito for WmTests to avoid
conflicting with extended-mockito.

Test: presubmit pass
Change-Id: If3f6d7a2ac52d3e8f72e9cbc88e54f0c4d4c47ce
2019-12-10 18:33:57 +08:00
Winson
3f46dbd7a0 Overlay, actor, and target app visibility handling
Hooks AppsFilter to support exposing a target and any overlays
targeting it to the actor specified in its overlayable block.

Sacrifices some install-time performance in favor of less memory
usage and easier to follow code by doing a full search/rebuild
on each change.

Benchmarks TBD

Bug: 143096091

Test: atest OverlayReferenceMapperTests

Change-Id: Ic832818b9aa383f1167ca3e69a11b8459fa9db97
2019-12-09 10:46:59 -08:00
Jorim Jaggi
956ca413e3 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Test: build on specific target
Change-Id: Ie35f4b4468bce7ef8c76f091e306610c069fba85
2019-10-19 16:59:06 +08:00
Ioannis Ilkos
8cca14103c Revert "Window Manager Flag Migration (4/n)"
This reverts commit cb1b848084be47118342c4893ede2298067c3d0f.

Reason for revert: Droidcop-triggered revert due to b/142849532

Change-Id: If81eba4e979e21202e78839bb1afbc66691098d2
2019-10-17 09:38:00 +00:00
Jorim Jaggi
cb1b848084 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Change-Id: I1dcaff47ae57ccee91146fdc042cde5e26fc0b3f
2019-10-17 01:41:34 +08:00
Roshan Pius
f145e1732e TestLooper: Some changes to test looper behavior
a) Add a new stopAutoDispatchAndIgnoreExceptions method
This method ignores exceptions raised when there are no messages
dispatched in the looper. Helps write negative unit tests for methods where
the runnables are not posted when some preconditions are not met.
Not starting the looper in these tests would make it
unclear whether the test failed because the looper was not running or
because the preconditions (like permission checks) where not satisfied.
b) Auto dispatch will only stop running when stopAutoDispatch is
invoked. Previously it stops running when it runs a single message. This
causes failures in unit tests for methods which posts multiple runnables
in the same method.

Bug: 138403307
Bug: 117601161
Test: atest com.android.server.wifi
Change-Id: Iab27d92d443c6d7364c52b86d51dd2cb7902358a
2019-09-19 20:41:32 -07:00
Jorim Jaggi
2862047fd7 Window Manager Flag Migration (2/n)
Adds policy to decide when focused window can control bars. And also
generalizes control target for:
a) Normal case: The focused window is the control target.
b) Transient bar case: The control target is a special object in WM
   that controls the transient animation.

Bug: 118118435
Test: atest InsetsPolicyTest InsetsStateControllerTest WindowStateTests
Change-Id: I4819d85eec745d56abe23dbca0905979da854e5e
2019-09-05 18:20:06 +08:00
Andrii Kulian
153f73cbcc Merge "Add unit tests for activity client state changes" into qt-dev 2019-04-16 21:18:18 +00:00
Andrii Kulian
ca7f710eee Add unit tests for activity client state changes
This also adds new module for tests that require Extended Mockito.

Bug: 127106719
Test: atest FrameworksCoreTests:android.app.activity.ActivityThreadTest
Change-Id: I7ed5de72d35babbbf72c4c823d3a9e4baa50e3c4
2019-04-05 16:07:59 -07:00
Roshan Pius
e602db5fb9 WifiScannerTest: More unit tests
Bug: 130035791
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ic4eb56fc3ba6bffd3df529432d17af0ba35b6333
2019-04-05 15:16:56 -07:00
Tadashi G. Takaoka
82eb7a5f63 Rename WM test filter to FrameworksTestsFilter
This CL adds android.view.InsetsAnimationControllerImplTest to the
test filter, and adds a comment to each tests mentioning about
FrameworksTestsFilter.

Test: Pass all 91 non-flaky presubmit tests in FrameworksCoreTests
      using FrameworksTestsFilter
  $ tradefed.sh run commandAndExit FrameworksCoreTests \
      --instrumentation-arg selectTest=com.android.server.wm. \
      --instrumentation-arg filter=com.android.server.wm.test.filters.FrameworksTestsFilter
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Bug: 122451194

Change-Id: I9592ff01158eec1b4ef4d0dd22be243e10bd198e
2019-03-26 22:15:22 +09:00
Tadashi G. Takaoka
9648d4b04b Make SelectTest append selectTest argument from extended class
This CL also moves CoreTestsFilter to frameworks/base/test-util, so
that FrameworksCoreTests, FrameworksServicesTests, and WmTests can use
CoreTestsFilter.

Test: Pass SelectTestTests
  $ atest WmTests:com.android.test.filters.SelectTestTests
Test: Pass all 91 non-flaky presubmit tests in FrameworksCoreTests using
  CoreTestsFilter
  $ tradefed.sh run commandAndExit WmTests \
      --instrumentation-arg selectTest=com.android.server.wm. \
      --instrumentation-arg filter=com.android.server.wm.test.filters.CoreTestsFilter
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Test: Pass all 740 non-flaky presubmit tests in WmTests using
  CoreTestsFilter
  $ tradefed.sh run commandAndExit WmTests \
      --instrumentation-arg selectTest=com.android.server.wm. \
      --instrumentation-arg filter=com.android.server.wm.test.filters.CoreTestsFilter
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Bug: 122451194
Change-Id: I83d13d9ef82a92677bee67da5ee8a5faa0690f82
2019-03-22 18:04:30 +09:00
Sasha Smundak
ba36f89d7f Merge "Convert tests/**/Android.mk files to Android.bp" am: 40ff4f7d83 am: c33506ce2f
am: c15ff15587

Change-Id: I55c5f273e09a2a0ad53fdd8cb4860f04207c4241
2019-03-09 08:25:50 -08:00
Sasha Smundak
b6aca11e80 Convert tests/**/Android.mk files to Android.bp
See build/soong/README.md for more information.

Note: tests/ImfTest/Android.mk causes conflict as it hasn't been yet
ported to internal master. Do it later.
Note: the conversion in the following directories has to be done in the
internal master first because of the conflicts:
* tests/ActivityManagerPerfTests
* tests/AppLaunch
* tests/AppLaunchWear
* tests/BackgroundDexOptServiceIntegrationTests
* tests/Camera2Tests/CameraToo
* tests/Camera2Tests/SmartCamera/SimpleCamera
* tests/Compatibility
* tests/Internal
* tests/RcsTests
* tests/ServiceCrashTest
* tests/UsbTests

Bug: 122332340
Test: treehugger
Change-Id: Ie17590c6a96aee5caa80d38092a3de5c1b6efe8d
2019-03-07 16:14:00 -08:00
Sasha Smundak
aef4b82881 Remove unused tests/utils/SleepUtils
The presense of these files hinders the conversion of the makefiles
to the blueprints (causes failure in the internal builds due to lacking
files).

Bug: 122332340
Test: treehugger
Change-Id: I2a3c38cbba7c14ae1b2880c73c7f6514816f0e68
2019-02-26 17:43:22 +00:00
Tarandeep Singh
a6f3561667 Reparent IME window and handle non-fullscreen windows correctly
IME window is attached to the IME target if possible. This ensures
a smooth enter/exit animation when the activity is coming in/going
away.

Furthermore, if the controlling window doesn't span the entire
display, we can't offer controlling it in a frame-by-frame
manner, and we need to do the inset calculations relative to the
display frame.

Test:
adb shell setprop persist.wm.new_insets 1
adb shell setprop persist.pre_render_ime_views 0

Test: Open IME, go home, reopen app
Test: Show dialog with EditText
Bug: 111084606
Change-Id: Id40470f6f8284b48acfa4719049afd14fde332d6
2019-02-07 15:56:21 +01:00
Tadashi G. Takaoka
0f224efb5e Add generic SelectTest JUnit filter and CoreTestsFilter
The JUnit filter com.android.test.filters.SelectTest is a generic test
filter that can supersede |-e package| and |-e class| options of
AndroidJUnitRunner.

The com.android.server.wm.test.filters.CoreTestsFilter extends SelectTest
filter to filter out Window Manager Service releated tests in
FrameworksCoreTests.

Bug: 122451194
Test: Can select some tests from WmTests.
  $ adb shell am instrument -w \
      -e filter com.android.test.filters.SelectTest \
      -e selectTest com.android.test.filters.,com.android.server.wm.DummyTests \
      com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Test: CoreTestsFilter works for FrameworksCoreTests.
  $ adb shell am instrument -w \
      -e filter com.android.server.wm.test.filters.CoreTestsFilter \
      -e selectTest_verbose true \
      com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic72637997bf17debef914e2596049f6cf3e753de
Merged-In: Ic72637997bf17debef914e2596049f6cf3e753de
2019-01-23 23:04:03 +09:00
Tadashi G. Takaoka
4ca00224e9 Fix some tests in SelectTestTests
This is a follow up of Ic72637997bf17debef914e2596049f6cf3e753de

Bug: 122451194
Test: atest FrameworksServicesTests:com.android.test.filters.SelectTestTests
Change-Id: I61c5837a097451a204e9602476c68fdda4fc30be
2019-01-23 22:16:05 +09:00
TreeHugger Robot
9e6a6185b6 Merge "Add generic SelectTest JUnit filter and CoreTestsFilter" 2019-01-23 08:17:31 +00:00
Tadashi G. Takaoka
2bc664065e Add generic SelectTest JUnit filter and CoreTestsFilter
The JUnit filter com.android.test.filters.SelectTest is a generic test
filter that can supersede |-e package| and |-e class| options of
AndroidJUnitRunner.

The com.android.server.wm.test.filters.CoreTestsFilter extends SelectTest
filter to filter out Window Manager Service releated tests in
FrameworksCoreTests.

Bug: 122451194
Test: Can select some tests from WmTests.
  $ adb shell am instrument -w \
      -e filter com.android.test.filters.SelectTest \
      -e selectTest com.android.test.filters.,com.android.server.wm.DockedStackDividerControllerTests \
      com.android.frameworks.wmtests/androidx.test.runner.AndroidJUnitRunner
Test: CoreTestsFilter works for FrameworksCoreTests.
  $ adb shell am instrument -w \
      -e filter com.android.server.wm.test.filters.CoreTestsFilter \
      -e selectTest_verbose true \
      com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ic72637997bf17debef914e2596049f6cf3e753de
2019-01-23 10:36:44 +09:00
Aurimas Liutikas
42249cb7c2 Remove unused SleepUtils.
This looks like dead code not used by anything in the tree.
It was added in ag/603441

Test: None
Change-Id: Ic424a25794d7c45719fa4f554cbf4f4b74288065
2019-01-22 13:48:47 -08:00
Brett Chabot
ec6bcbceee Fix FrameworksServicesTests:StorageManagerServiceTest
Use androidx.test not android.support.test.
And remove android.support.test from build by removing unnecessary
frameworks-base-testutils > android.support.test dependency

Bug: 117990406
Test: m checkbuild; atest FrameworksServicesTests:StorageManagerServiceTest
Change-Id: Ia825e0926b46855f9056739441cb21a065692076
2018-11-06 10:48:19 -08:00
Colin Cross
74835a2a4f Convert frameworks-base-testutils to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Change-Id: I2d70f7c017fc3d181c70b030e39e5a932d0996cc
2018-08-16 22:25:40 -07:00
Tyler Gunn
f955e56d51 Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state
broadcast and via the PhoneStateListener.  To enhance user privacy, change
to require the READ_CALL_LOG permission in order to receive the call
phone numbers.

This means to see phone numbers:
1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and
READ_CALL_LOG permission.
2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG
permission.

To support this new behavior, added sendBroadcastAsUserMultiplePermissions
method to context to allow sending the broadcast to all users while
requiring the two permissions.

Bug: 78650469
Test: Created PHONE_STATE broadcast receiver in test app and verified that
when no permissions are granted, the phone number is empty for incoming
and outgoing calls.
Test: Granted Phone state permission to test app and verified that phone
number is not populated.
Test: Granted test app read call log permission and verified that phone
number is populated.
Test: Created PhoneStateListener in test app and verified that when no
permissions are granted, phone number is empty for incoming and outgoing.
calls.
Test: Granted read call log permission to test app and verified that both
the incoming and outgoing numbers are populated.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2018-04-27 08:44:07 -07:00
Anton Hansson
ab6ec61251 frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 15:13:23 +00:00
Etan Cohen
cff2fe4f76 Add Executor to the TestLooper
Add a method to obtain an Executor from a TestLooper: the executor
executes on a new Handler on the test looper.

Bug: 73088768
Test: new unit test for executor
Change-Id: Ib0aa10011116a4d998f8d3a7434939338d9b516d
2018-02-16 10:13:26 -08:00
Philip P. Moltmann
9addc597e3 Don't include mockito in frameworks-base-testutils
So that each test can pick if they want mockito-inline or not.

Test: m -j checkbuild
Change-Id: I1ac02acebbe5cd01f3032a10932a1c612d8d3a4d
2017-12-19 13:22:14 -08:00
Paul Duffin
2710ca1e9d Flatten dependency hierarchy of legacy-android-test
Previous changes statically included legacy-android-test in preparation
for removing android.test.* and junit.* classes from the android.jar.
Unfortunately, that lead to duplicate classes between APKs and the
bootclasspath which caused build problems (Proguard) and also runtime
problems (when targeting and running on older releases).

Switching from statically including the classes to using the runtime
libraries cannot be done in one step because legacy-android-test is
statically included in libraries which are used in many APKs and so
removing it from those libraries requires that all APKs be updated at
once. Doing that atomically across dozens of projects is not practical.

This change modifies APKS that statically include the
legacy-android-test library indirectly.

* If the APK manifest uses the android.test.runner library then the APK
  is modified to stop statically including legacy-android-test and
  instead build against android.test.base/mock/runner libraries instead.

* Otherwise, the APK statically includes legacy-android-test.

Also, any libraries that statically include are modified to stop
statically including it and if it has source dependencies on the classes
is changed to build against the android.test.base/mock/runner libraries.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* cmds/uiautomator/instrumentation/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because uiautomator-instrumentation is not a package so does not
    need to statically include the classes

* cmds/uiautomator/library/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    uiautomator.core has a source dependency on its classes

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because uiautomator.core is not a package so does not need to
    statically include the classes

* core/tests/BroadcastRadioTests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    BroadcastRadioTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.
    The classes do not need to be statically included because the
    classes will be provided by the runtime, either from the default
    bootclasspath or from the android.test.runner library that
    BroadcastRadioTests specifies in its manifest.

* core/tests/coretests/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because FrameworksCoreTests's source depends
    on their classes and because of these changes they are no longer
    present on the compilation path. The classes do not need to be
    statically included because the classes will be provided by the
    runtime, either from the default bootclasspath or from the
    android.test.runner library that FrameworksCoreTests specifies in
    its manifest.

* core/tests/featureflagtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksCoreFeatureFlagTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that FrameworksCoreFeatureFlagTests specifies in its manifest.

* core/tests/systemproperties/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksCoreSystemPropertiesTests's source depends on its classes
    and because of these changes they are no longer present on the
    compilation path. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that FrameworksCoreSystemPropertiesTests specifies in its manifest.

* core/tests/utillib/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because frameworks-core-util-lib is not a package so does not need
    to statically include the classes

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    frameworks-core-util-lib has a source dependency on its classes

* core/tests/utiltests/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because FrameworksUtilTests's source depends
    on their classes and because of these changes they are no longer
    present on the compilation path. The classes do not need to be
    statically included because the classes will be provided by the
    runtime, either from the default bootclasspath or from the
    android.test.runner library that FrameworksUtilTests specifies in
    its manifest.

* location/tests/locationtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksLocationTests's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path. The classes do not need to be statically included because the
    classes will be provided by the runtime, either from the default
    bootclasspath or from the android.test.runner library that
    FrameworksLocationTests specifies in its manifest.

* lowpan/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksLowpanApiTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that FrameworksLowpanApiTests specifies in its manifest.

* packages/Osu2/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    OsuTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path. The
    classes do not need to be statically included because the classes
    will be provided by the runtime, either from the default
    bootclasspath or from the android.test.runner library that OsuTests
    specifies in its manifest.

* packages/SettingsProvider/test/Android.mk
    Replaced 'legacy-android-test' with 'android.test.base' in
    LOCAL_JAVA_LIBRARIES because SettingsProviderTest's source depends
    on its classes. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that SettingsProviderTest specifies in its manifest.

* services/tests/notification/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksNotificationTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that FrameworksNotificationTests specifies in its manifest.

* services/tests/servicestests/Android.mk
    Replaced 'legacy-android-test' with 'android.test.base' and
    'android.test.runner' in LOCAL_JAVA_LIBRARIES because
    FrameworksServicesTests's source depends on their classes. The
    classes do not need to be statically included because the classes
    will be provided by the runtime, either from the default
    bootclasspath or from the android.test.runner library that
    FrameworksServicesTests specifies in its manifest.

* services/tests/shortcutmanagerutils/Android.mk
    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    ShortcutManagerTestUtils has a source dependency on its classes

* tests/AppLaunch/Android.mk
    Replaced 'legacy-android-test' with 'android.test.base' and
    'android.test.runner' in LOCAL_JAVA_LIBRARIES because AppLaunch's
    source depends on their classes. The classes do not need to be
    statically included because the classes will be provided by the
    runtime, either from the default bootclasspath or from the
    android.test.runner library that AppLaunch specifies in its
    manifest.

* tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.mk
    Replaced 'legacy-android-test' with 'android.test.base' in
    LOCAL_JAVA_LIBRARIES because SmartCamera-tests's source depends on
    its classes. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that SmartCamera-tests specifies in its manifest.

* tests/ServiceCrashTest/Android.mk
    Replaced 'legacy-android-test' with 'android.test.base' in
    LOCAL_JAVA_LIBRARIES because ServiceCrashTest's source depends on
    its classes. The classes do not need to be statically included
    because the classes will be provided by the runtime, either from
    the default bootclasspath or from the android.test.runner library
    that ServiceCrashTest specifies in its manifest.

* tests/net/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because FrameworksNetTests's source depends on
    their classes and because of these changes they are no longer
    present on the compilation path. The classes do not need to be
    statically included because the classes will be provided by the
    runtime, either from the default bootclasspath or from the
    android.test.runner library that FrameworksNetTests specifies in
    its manifest.

* tests/testables/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because testables is not a package so does not need to statically
    include the classes

    Added 'android.test.mock' to LOCAL_JAVA_LIBRARIES because testables
    has a source dependency on its classes

* tests/utils/testutils/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because frameworks-base-testutils is not a package so does not need
    to statically include the classes

    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because frameworks-base-testutils has a source
    dependency on their classes

* wifi/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksWifiApiTests's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path. The classes do not need to be statically included because the
    classes will be provided by the runtime, either from the default
    bootclasspath or from the android.test.runner library that
    FrameworksWifiApiTests specifies in its manifest.

Bug: 30188076
Test: make checkbuild
Change-Id: Ia6a48234f28e7e1789049cf4b37cd7fe0bc8251c
2017-12-07 07:38:59 +00:00
Sudheer Shanka
aa3c30dfa2 Add a way to clear cached provider for tests in Settings class.
Bug: 38437704
Bug: 38433611
Test: manual
Change-Id: Id2803359644bd68a158294b6d801fc9cd316fc9f
2017-05-26 18:53:06 +00:00
Paul Duffin
8aeb59ebcd Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
2017-01-18 16:39:34 +00:00
Lorenzo Colitti
281a17c958 De-guava BroadcastInterceptingContext and move it to testutils.
Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest  # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
2016-10-28 17:12:36 +09:00
Lorenzo Colitti
7df1a82802 Move FakeSettingsProvider to a common location.
Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I82a1a1a7219cf1385092b84d85eddf9dda90c685
2016-10-28 17:12:31 +09:00
Mitchell Wills
d3868cfc63 Don't pull in external/junit through mockito
android-support-test provides a different version of junit

FIXED=30481239

Change-Id: I6d8f52d5f82b4c9905da8cc4a6ca79216eba9e26
2016-07-28 17:05:17 -07:00
Christopher Wiley
07630f6bd3 Create frameworks-base-testutils lib
This permits sharing of test components used in connectivity tests.
Rename the MockLooper to TestLooper, reflecting that it is not a
true mock, but a manually controlled Looper for use in tests.

Bug: 28848133
Test: Tests consuming this library pass.

Change-Id: I57e11f9544c7bffdb02739ab2a921512b1b11874
2016-05-19 13:12:09 -07:00
Guang Zhu
18b892c723 shell based UI Automator source move
frameworks/testing/uiautomator -> frameworks/base/cmds/uiautomator
  (samples, utils sub folders exlcuded)
frameworks/testing/uiautomator/utils -> frameworks/base/tests/utils

no source files changed, only one line makefile update (for
UI Automator API check)

Bug: 18708851
Change-Id: I396bd386d3d55a52df18af183685daf80caa9f73
2014-12-12 17:31:38 -08:00