From 1b9724659a7607ef10cecfb2b1053a3d05cc5028 Mon Sep 17 00:00:00 2001 From: Suprabh Shukla Date: Fri, 8 Nov 2019 17:04:56 -0800 Subject: Updating usages of refactored WorkSource API Test: Mechanical refactoring. Existing tests pass: atest FrameworksWifiTests Bug: 143551137 Change-Id: I679915732d48a0e957668e450c5d0e2a6faaa748 --- .../src/com/android/server/wifi/WifiNetworkFactoryTest.java | 2 +- .../src/com/android/server/wifi/rtt/RttServiceImplTest.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java index f312756dd..34bd82574 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java @@ -2862,7 +2862,7 @@ public class WifiNetworkFactoryTest extends WifiBaseTest { } WorkSource workSource = mWorkSourceArgumentCaptor.getValue(); assertNotNull(workSource); - assertEquals(TEST_UID_1, workSource.get(0)); + assertEquals(TEST_UID_1, workSource.getUid(0)); } class WifiConfigMatcher implements ArgumentMatcher { diff --git a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java index a355540ff..8086b0cda 100644 --- a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java @@ -623,6 +623,9 @@ public class RttServiceImplTest extends WifiBaseTest { mockCallback); mMockLooper.dispatchAll(); + // verify metrics + verify(mockMetrics).recordRequest(eq(worksourceRequest), eq(request)); + // (2) verify that request issued to native verify(mockNative).rangeRequest(mIntCaptor.capture(), eq(request), eq(true)); verifyWakeupSet(true, 0); @@ -638,9 +641,6 @@ public class RttServiceImplTest extends WifiBaseTest { mDut.onRangingResults(mIntCaptor.getValue(), results.second); mMockLooper.dispatchAll(); - // verify metrics - verify(mockMetrics).recordRequest(eq(worksourceRequest), eq(request)); - verify(mockNative, atLeastOnce()).isReady(); verifyNoMoreInteractions(mockNative, mockMetrics, mockCallback, mAlarmManager.getAlarmManager()); @@ -670,6 +670,9 @@ public class RttServiceImplTest extends WifiBaseTest { mockCallback); mMockLooper.dispatchAll(); + // verify metrics + verify(mockMetrics).recordRequest(eq(worksourceRequest), eq(request)); + // (2) verify that request issued to native verify(mockNative).rangeRequest(mIntCaptor.capture(), eq(request), eq(true)); verifyWakeupSet(true, 0); @@ -685,7 +688,6 @@ public class RttServiceImplTest extends WifiBaseTest { verifyWakeupCancelled(); // verify metrics - verify(mockMetrics).recordRequest(eq(worksourceRequest), eq(request)); verify(mockMetrics).recordResult(eq(request), eq(results.second)); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); -- cgit v1.2.3