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

Commit 03edcfc2 authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Merge "Update sequence and method of the mock object to prevent flaky" am:...

Merge "Update sequence and method of the mock object to prevent flaky" am: 68d4975b am: 52363099 am: c55e9e20 am: d710918d am: a3d23da2 am: 9b3062e7

Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1368136

Change-Id: If36d7b96f273a111b7e03ced5b7d6c652bb8c45d
parents c9bc5c64 9b3062e7
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1931,12 +1931,11 @@ public class NetworkMonitorTest {
            throws Exception {
        assumeTrue(ShimUtils.isReleaseOrDevelopmentApiAbove(Build.VERSION_CODES.Q));
        setupTcpDataStall();
        setTcpPollingInterval(0);
        // NM suspects data stall from TCP signal and sends data stall metrics.
        setDataStallEvaluationType(DATA_STALL_EVALUATION_TYPE_TCP);
        final WrappedNetworkMonitor nm = prepareNetworkMonitorForVerifyDataStall(nc);

        // Trigger a tcp event immediately.
        setTcpPollingInterval(0);
        nm.sendTcpPollingEvent();
        // Allow only one transport type in the context of this test for simplification.
        final int[] transports = nc.getTransportTypes();
@@ -2546,8 +2545,8 @@ public class NetworkMonitorTest {
    }

    private void setTcpPollingInterval(int time) {
        when(mDependencies.getDeviceConfigPropertyInt(any(),
                eq(CONFIG_DATA_STALL_TCP_POLLING_INTERVAL), anyInt())).thenReturn(time);
        doReturn(time).when(mDependencies).getDeviceConfigPropertyInt(any(),
                eq(CONFIG_DATA_STALL_TCP_POLLING_INTERVAL), anyInt());
    }

    private void setFallbackUrl(String url) {