diff options
author | Suprabh Shukla <suprabh@google.com> | 2019-11-08 17:04:56 -0800 |
---|---|---|
committer | Suprabh Shukla <suprabh@google.com> | 2019-11-14 12:02:44 -0800 |
commit | 1b9724659a7607ef10cecfb2b1053a3d05cc5028 (patch) | |
tree | e6ae50c80f8a6765d48eb2c9cbe1927e31291010 /tests | |
parent | 85065f59a468847d6abe349f182623ed4f94aa71 (diff) |
Updating usages of refactored WorkSource API
Test: Mechanical refactoring. Existing tests pass:
atest FrameworksWifiTests
Bug: 143551137
Change-Id: I679915732d48a0e957668e450c5d0e2a6faaa748
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java | 2 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java | 10 |
2 files changed, 7 insertions, 5 deletions
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<WifiConfiguration> { 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); |