Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a68cf306 authored by Michal Belusiak's avatar Michal Belusiak
Browse files

BassClientServiceTest: Mechanical refactor

- add helper functions to reduce the lines of code
- remove timeouts to reduce overall time of tests execution
- add new way of controlling BassClientService timeouts
- prepareConnectedDeviceGroup by default creates one place
for broadcast source addition
- remove unnecessary testDevice creation
- create global mInOrderMethodProxy
- change deprecated enableFlags/disableFlags to new
@EnableFlags/@DisableFlags annotations
- change assertThat to expect on serial checks at the end of a tests

Bug: 355218881
Flag: Exempt, tests changes only
Test: atest BassClientServiceTest
Change-Id: I8afe8e09bcc9c5328c8cf2b57c89341b0ff074ef
parent ce649c40
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -118,13 +118,13 @@ public class BassClientService extends ProfileService {
    private static final int BROADCAST_STATE_STOPPING = 3;
    private static final int BROADCAST_STATE_STREAMING = 4;

    private static final int MESSAGE_SYNC_TIMEOUT = 1;
    @VisibleForTesting static final int MESSAGE_SYNC_TIMEOUT = 1;

    /* 1 minute timeout for primary device reconnection in Private Broadcast case */
    private static final int DIALING_OUT_TIMEOUT_MS = 60000;

    // 30 secs timeout for keeping PSYNC active when searching is stopped
    @VisibleForTesting static Duration sSyncActiveTimeout = Duration.ofSeconds(30);
    private static final Duration sSyncActiveTimeout = Duration.ofSeconds(30);

    private static BassClientService sService;

@@ -188,7 +188,8 @@ public class BassClientService extends ProfileService {

    @VisibleForTesting ServiceFactory mServiceFactory = new ServiceFactory();

    private final Handler mHandler =
    @VisibleForTesting
    final Handler mHandler =
            new Handler(Looper.getMainLooper()) {
                @Override
                public void handleMessage(Message msg) {
+814 −1651

File changed.

Preview size limit exceeded, changes collapsed.