Files
frameworks_base/core/tests/mockingcoretests
Andrii Kulian b9faa03b90 Use START/STOP messages to update visibility
Activity visibility messages simply move the activity to STOPPED or
STARTED state. We can use the lifecycle messages to do the same and
simplify the logic/remove duplicated code.

This CL also removes the option to send STOP message without making
the client invisible and actually calling onStop(). This option
caused a mismatch of the state between server (STOPPED) and client
(PAUSED). Also, in cases when the device was going to sleep, STOP
message was always followed by SLEEP message, which called onStop()
anyway.

Bug: 137329632
Bug: 129750406
Test: AM/WM CTS and unit tests
Change-Id: I487575520ce301bb2f65519f0c0a30b6b9edac0c
2020-01-08 15:29:57 -08:00
..

* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.


INTRODUCTION

The Android platform core tests that require additional mocking capabilities and use Extended
Mockito, such as the ability to stub static methods. ExtendedMockito is not fully compatible with
regular Mockito library, so tests that use it have to be verified and adapted. For that reason a
separate module is used instead of adding to FrameworksCoreTests.

For more information about ExtendedMockito see documentation of
com.android.dx.mockito.inline.extended.ExtendedMockito class.

See ../coretests/README for more information on FrameworksCoreTests.


INSTRUCTIONS

To build, install and run:

  atest FrameworksMockingCoreTests