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

Commit 261c975e authored by James Mattis's avatar James Mattis
Browse files

Updating tests to honor per-app TRACK_DEFAULT

Per-app APIs in ConnectivityService will now have their fallback
request which tracks the system default be of type TRACK_DEFAULT
as opposed to REQUEST. Existing tests which expect this fallback request
to be sent to network factories need to be updated to validate this
change.

Bug: 180452284
Bug: 176494815
Test: atest FrameworksNetTests
Change-Id: I5125755b3ed1ec535494e2d7a48c0860710ed056
parent 8d64dfc8
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -11693,10 +11693,12 @@ public class ConnectivityServiceTest {
                mServiceContext, "internetFactory", internetFilter, mCsHandlerThread);
        internetFactory.setScoreFilter(40);
        internetFactory.register();
        // Default internet request & 3rd (fallback) request in OEM_PAID NRI. The unmetered request
        // is never sent to factories (it's a LISTEN, not requestable) and the OEM_PAID request
        // doesn't match the internetFactory filter.
        internetFactory.expectRequestAdds(2);
        // Default internet request only. The unmetered request is never sent to factories (it's a
        // LISTEN, not requestable). The 3rd (fallback) request in OEM_PAID NRI is TRACK_DEFAULT
        // which is also not sent to factories. Finally, the OEM_PAID request doesn't match the
        // internetFactory filter.
        internetFactory.expectRequestAdds(1);
        internetFactory.assertRequestCountEquals(1);
        NetworkCapabilities oemPaidFilter = new NetworkCapabilities()
                .addCapability(NET_CAPABILITY_INTERNET)
@@ -11719,7 +11721,7 @@ public class ConnectivityServiceTest {
        expectNoRequestChanged(oemPaidFactory);
        oemPaidFactory.assertRequestCountEquals(1);
        // The internet factory however is outscored, and should lose its requests.
        internetFactory.expectRequestRemoves(2);
        internetFactory.expectRequestRemove();
        internetFactory.assertRequestCountEquals(0);
        final NetworkCapabilities oemPaidNc = new NetworkCapabilities();