Remove an obsolete verification from test.

Also, add the test to Presubmit.

Fixes: 279050655
Test: atest com.android.server.am.ActivityManagerInternalTest
Change-Id: Ife88667dbc69863c4cab64d56ab2bdc560a9aaaf
This commit is contained in:
Sudheer Shanka
2023-04-23 07:55:09 +00:00
parent 150c188a69
commit 84ae3dd55c

View File

@@ -23,8 +23,9 @@ import static org.mockito.Mockito.doReturn;
import android.app.ActivityManagerInternal;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -39,13 +40,14 @@ import org.mockito.MockitoAnnotations;
* Build/Install/Run:
* atest FrameworksServicesTests:ActivityManagerInternalTest
*/
@Presubmit
@SmallTest
public class ActivityManagerInternalTest {
private static final int TEST_UID1 = 111;
private static final int TEST_UID2 = 112;
private static final long TEST_PROC_STATE_SEQ1 = 1111;
private static final long TEST_PROC_STATE_SEQ2 = 1112;
private static final long TEST_PROC_STATE_SEQ3 = 1113;
@Rule public ServiceThreadRule mServiceThreadRule = new ServiceThreadRule();
@@ -68,7 +70,6 @@ public class ActivityManagerInternalTest {
mAmi = mAms.new LocalService();
}
@MediumTest
@Test
public void testNotifyNetworkPolicyRulesUpdated() throws Exception {
// Check there is no crash when there are no active uid records.
@@ -89,14 +90,6 @@ public class ActivityManagerInternalTest {
TEST_PROC_STATE_SEQ1, // lastNetworkUpdateProcStateSeq
TEST_PROC_STATE_SEQ1, // procStateSeq to notify
false); // expectNotify
// Notify that network policy rules are updated for TEST_UID1 with procStateSeq older
// than it's UidRecord.curProcStateSeq and verify that there is no notify call.
verifyNetworkUpdatedProcStateSeq(
TEST_PROC_STATE_SEQ3, // curProcStateSeq
TEST_PROC_STATE_SEQ1, // lastNetworkUpdateProcStateSeq
TEST_PROC_STATE_SEQ2, // procStateSeq to notify
false); // expectNotify
}
private void verifyNetworkUpdatedProcStateSeq(long curProcStateSeq,