Home
last modified time | relevance | path

Searched refs:rule (Results 1 – 25 of 234) sorted by relevance

12345678910

/platform_testing/libraries/health/rules/tests/src/android/platform/test/rule/
DTracePointRuleTest.java16 package android.platform.test.rule;
37 TestableTracePointRule rule = new TestableTracePointRule(); in testNoNameGiven() local
38 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testNoNameGiven()
40 assertThat(rule.getOperations()).contains("begin: mthd(clzz)"); in testNoNameGiven()
46 TestableTracePointRule rule = new TestableTracePointRule(""); in testEmptyStringGiven() local
47 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testEmptyStringGiven()
49 assertThat(rule.getOperations()).contains("begin: mthd(clzz)"); in testEmptyStringGiven()
55 TestableTracePointRule rule = new TestableTracePointRule("FakeName"); in testTagGiven() local
56 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testTagGiven()
58 assertThat(rule.getOperations()).contains("begin: FakeName"); in testTagGiven()
[all …]
DTestWatcherTest.java16 package android.platform.test.rule;
38 TestableTestWatcher rule = in testAllCallsSuccessful() local
40 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testAllCallsSuccessful()
42 assertThat(rule.getOperations()) in testAllCallsSuccessful()
50 TestableTestWatcher rule = in testCallsFail_starting() local
53 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testCallsFail_starting()
57 assertThat(rule.getOperations()) in testCallsFail_starting()
66 TestableTestWatcher rule = in testCallsFail_statement() local
69 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testCallsFail_statement()
73 assertThat(rule.getOperations()) in testCallsFail_statement()
[all …]
DKillAppsRuleTest.java16 package android.platform.test.rule;
45 KillAppsRule rule = new KillAppsRule(); in testNoAppToKillFails() local
57 TestableKillAppsRule rule = new TestableKillAppsRule(new Bundle(), "example.package.name"); in testOneAppToKill() local
58 rule.apply(rule.getTestStatement(), createTestDescription("clzz", "mthd")) in testOneAppToKill()
60 assertThat(rule.getOperations()) in testOneAppToKill()
70 TestableKillAppsRule rule = new TestableKillAppsRule(new Bundle(), false, in testOneAppToKillAfterTestRun() local
72 rule.apply(rule.getTestStatement(), createTestDescription("clzz", "mthd")) in testOneAppToKillAfterTestRun()
74 assertThat(rule.getOperations()) in testOneAppToKillAfterTestRun()
84 TestableKillAppsRule rule = new TestableKillAppsRule(new Bundle(), in testMultipleAppsToKill() local
88 rule.apply(rule.getTestStatement(), createTestDescription("clzz", "mthd")) in testMultipleAppsToKill()
[all …]
DCompilationFilterRuleTest.java16 package android.platform.test.rule;
49 TestableCompilationFilterRule rule = in testNoAppToCompile() local
57 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd1")) in testNoAppToCompile()
68 TestableCompilationFilterRule rule = in testSingleAppToCompile() local
76 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd2")) in testSingleAppToCompile()
80 assertThat(rule.getOperations()).containsExactly("test", compileCmd).inOrder(); in testSingleAppToCompile()
88 TestableCompilationFilterRule rule = new TestableCompilationFilterRule(badFilterBundle, in testAppToCompile_badFilterThrows() local
91 rule.apply(rule.getTestStatement(), TEST_DESC).evaluate(); in testAppToCompile_badFilterThrows()
102 TestableCompilationFilterRule rule = new TestableCompilationFilterRule(filterBundle, in testAppToCompile_failCompilationThrows() local
111 rule.apply(rule.getTestStatement(), TEST_DESC).evaluate(); in testAppToCompile_failCompilationThrows()
[all …]
DDropCachesRuleTest.java16 package android.platform.test.rule;
41 TestableDropCachesRule rule = new TestableDropCachesRule(new Bundle()); in testDropCachesCommand() local
42 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testDropCachesCommand()
44 assertThat(rule.getOperations()) in testDropCachesCommand()
45 .containsExactly("sync", rule.getDropCacheScriptPath(), "test") in testDropCachesCommand()
56 TestableDropCachesRule rule = new TestableDropCachesRule(noDropCacheBundle); in testNoDropCacheFlag() local
58 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testNoDropCacheFlag()
60 assertThat(rule.getOperations()).containsExactly("test") in testNoDropCacheFlag()
69 TestableDropCachesRule rule = new TestableDropCachesRule(noSyncBundle); in testNoSync() local
71 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testNoSync()
[all …]
DQuickstepPressureRuleTest.java16 package android.platform.test.rule;
40 TestableQuickstepPressureRule rule = new TestableQuickstepPressureRule(); in testNoAppToOpenFails() local
41 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testNoAppToOpenFails()
52 TestableQuickstepPressureRule rule = in testOneAppToOpen() local
54 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testOneAppToOpen()
56 assertThat(rule.getOperations()) in testOneAppToOpen()
64 TestableQuickstepPressureRule rule = in testMultipleAppsToOpen() local
67 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testMultipleAppsToOpen()
69 assertThat(rule.getOperations()) in testMultipleAppsToOpen()
80 TestableQuickstepPressureRule rule = new TestableQuickstepPressureRule(PackageOption); in testOneAppToOpenFromOption() local
[all …]
DStopwatchRuleTest.java17 package android.platform.test.rule;
40 StopwatchRule rule = new StopwatchRule(); in testMeasurementIsCorrect() local
41 rule.apply( in testMeasurementIsCorrect()
51 Bundle metric = rule.getMetric(); in testMeasurementIsCorrect()
60 StopwatchRule rule = new StopwatchRule(); in testMetricSendToInstr() local
62 rule.setInstrumentation(instr); in testMetricSendToInstr()
63 rule.apply( in testMetricSendToInstr()
70 verify(instr).sendStatus(StopwatchRule.INST_STATUS_IN_PROGRESS, rule.getMetric()); in testMetricSendToInstr()
77 TestableStopwatchRule rule = new TestableStopwatchRule(args); in testMetricKeyWithoutAppend() local
78 rule.apply( in testMetricKeyWithoutAppend()
[all …]
DUnlockScreenRuleTest.java16 package android.platform.test.rule;
43 TestableUnlockScreenRule rule = new TestableUnlockScreenRule(false, false); in testScreenOff() local
49 verify(rule.getUiDevice(), times(1)).wakeUp(); in testScreenOff()
50 verify(rule.getUiDevice(), times(1)).pressMenu(); in testScreenOff()
53 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")).evaluate(); in testScreenOff()
59 TestableUnlockScreenRule rule = new TestableUnlockScreenRule(true, false); in testScreenLocked() local
65 verify(rule.getUiDevice(), times(0)).wakeUp(); in testScreenLocked()
66 verify(rule.getUiDevice(), times(1)).pressMenu(); in testScreenLocked()
69 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")).evaluate(); in testScreenLocked()
75 TestableUnlockScreenRule rule = new TestableUnlockScreenRule(true, true); in testScreenOn() local
[all …]
DNotificationPressureRuleTest.java17 package android.platform.test.rule;
42 TestableNotificationPressureRule rule = in testPostNotifications_withoutPackage() local
49 verify(rule.initNotificationHelper()) in testPostNotifications_withoutPackage()
54 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")) in testPostNotifications_withoutPackage()
58 verify(rule.initNotificationHelper()).cancelNotifications(); in testPostNotifications_withoutPackage()
67 TestableNotificationPressureRule rule = in testPostNotifications_withPackage() local
74 verify(rule.initNotificationHelper()) in testPostNotifications_withPackage()
79 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")).evaluate(); in testPostNotifications_withPackage()
82 verify(rule.initNotificationHelper()).cancelNotifications(); in testPostNotifications_withPackage()
DRemoveAppFromStackRuleTest.java16 package android.platform.test.rule;
49 RemoveAppFromStackRule rule = new RemoveAppFromStackRule(); in testNoAppToRemoveFromStackFails() local
61 TestableRule rule = new TestableRule(new Bundle(), "example.package.name"); in testRemoveAppFromStack() local
62 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testRemoveAppFromStack()
64 assertThat(rule.getOperations()).containsExactly( in testRemoveAppFromStack()
79 TestableRule rule = new TestableRule(noRemoveAppFromStackBundle, "example.package.name"); in testDisableRemoveAppFromStack() local
80 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testDisableRemoveAppFromStack()
82 assertThat(rule.getOperations()).containsExactly("test").inOrder(); in testDisableRemoveAppFromStack()
DFinishActivitiesWithoutProcessKillRuleTest.java16 package android.platform.test.rule;
48 FinishActivitiesWithoutProcessKillRule rule = in testNoAppToFinishActivitiesFails() local
61 TestableRule rule = new TestableRule(new Bundle(), "example.package.name"); in testFinishActivities() local
62 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testFinishActivities()
64 assertThat(rule.getOperations()).containsExactly( in testFinishActivities()
80 TestableRule rule = new TestableRule(bundle, "example.package.name"); in testDisableFinishActivities() local
81 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testDisableFinishActivities()
83 assertThat(rule.getOperations()).containsExactly("test").inOrder(); in testDisableFinishActivities()
DKillAppsOnFailureRuleTest.java17 package android.platform.test.rule;
55 TestableKillAppsOnFailureRule rule = new TestableKillAppsOnFailureRule(null); in testDefaultDoesNothing() local
57 rule.apply(FAILING_TEST_STATEMENT, TEST_DESCRIPTION).evaluate(); in testDefaultDoesNothing()
59 verify(rule.getUiDevice(), never()).executeShellCommand(any()); in testDefaultDoesNothing()
65 TestableKillAppsOnFailureRule rule = new TestableKillAppsOnFailureRule(app); in testKillsSpecifiedApp() local
67 rule.apply(FAILING_TEST_STATEMENT, TEST_DESCRIPTION).evaluate(); in testKillsSpecifiedApp()
68 verify(rule.getUiDevice(), times(1)) in testKillsSpecifiedApp()
75 TestableKillAppsOnFailureRule rule = new TestableKillAppsOnFailureRule(apps); in testKillsSpecifiedApps() local
77 rule.apply(FAILING_TEST_STATEMENT, TEST_DESCRIPTION).evaluate(); in testKillsSpecifiedApps()
79 InOrder order = inOrder(rule.getUiDevice()); in testKillsSpecifiedApps()
[all …]
DCoolDownRuleTest.java16 package android.platform.test.rule;
67 TestableRule rule = getDefaultRule(screenOn, maxWait, abortOnTimeout); in testCoolDownNormal() local
72 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testCoolDownNormal()
74 assertThat(rule.getOperations()) in testCoolDownNormal()
94 TestableRule rule = new TestableRule(screenOn, mThermalHelper); in testCoolDownFallback() local
95 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testCoolDownFallback()
97 assertThat(rule.getOperations()).containsExactly(OPS_TEST).inOrder(); in testCoolDownFallback()
106 TestableRule rule = getDefaultRule(screenOn, maxWait, abortOnTimeout); in testCoolDownTimeout() local
112 rule.apply(rule.getTestStatement(), Description.createTestDescription("clzz", "mthd")) in testCoolDownTimeout()
114 assertThat(rule.getOperations()) in testCoolDownTimeout()
[all …]
DSetDefaultVolumeRuleTest.kt17 package android.platform.test.rule
32 val rule = in testSetDefaultMinVolumeRule() constant
34 rule.setAudioManager(mockAudioManager) in testSetDefaultMinVolumeRule()
35 rule.apply(statement, description).evaluate() in testSetDefaultMinVolumeRule()
49 val rule = in testSetDefaultMaxVolumeRule() constant
51 rule.setAudioManager(mockAudioManager) in testSetDefaultMaxVolumeRule()
52 rule.apply(statement, description).evaluate() in testSetDefaultMaxVolumeRule()
DPressHomeRuleTest.java16 package android.platform.test.rule;
46 TestablePressHomeRule rule = new TestablePressHomeRule(pressHomeBundle); in testPressHomeEnabled() local
52 verify(rule.getUiDevice(), never()).pressHome(); in testPressHomeEnabled()
55 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")).evaluate(); in testPressHomeEnabled()
57 verify(rule.getUiDevice(), times(1)).pressHome(); in testPressHomeEnabled()
68 TestablePressHomeRule rule = new TestablePressHomeRule(pressHomeBundle); in testPressHomeDisabled() local
74 verify(rule.getUiDevice(), never()).pressHome(); in testPressHomeDisabled()
77 rule.apply(testStatement, Description.createTestDescription("clzz", "mthd")).evaluate(); in testPressHomeDisabled()
79 verify(rule.getUiDevice(), times(0)).pressHome(); in testPressHomeDisabled()
DGarbageCollectRuleTest.java16 package android.platform.test.rule;
44 GarbageCollectRule rule = new TestableGarbageCollectRule(); in testNoGcBeforeTest() local
51 rule.apply(testStatement, in testNoGcBeforeTest()
62 GarbageCollectRule rule = new TestableGarbageCollectRule("package.name1"); in testCallsGcBeforeTest() local
75 rule.apply(testStatement, in testCallsGcBeforeTest()
86 GarbageCollectRule rule = new TestableGarbageCollectRule(gcEndBundle, "package.name1"); in testCallsGcBeforeAndAfterTest() local
95 rule.apply(testStatement, in testCallsGcBeforeAndAfterTest()
108 GarbageCollectRule rule = new TestableGarbageCollectRule(gcEndBundle, "package.name1"); in testCallsGcOnlyBeforeTest() local
117 rule.apply(testStatement, in testCallsGcOnlyBeforeTest()
129 GarbageCollectRule rule = new TestableGarbageCollectRule(gcEndBundle, "package.name1"); in testExtendWaitTime() local
[all …]
DWaitForIdleTimeoutRuleTest.java16 package android.platform.test.rule;
79 WaitForIdleTimeoutRule rule = createRule(timeout, false); in testSetsAndRestoresTimeout() local
81 rule.apply(TEST_STATEMENT, DESCRIPTION).evaluate(); in testSetsAndRestoresTimeout()
95 WaitForIdleTimeoutRule rule = createRule(777L, null); in testDisable() local
97 rule.apply(TEST_STATEMENT, DESCRIPTION).evaluate(); in testDisable()
109 WaitForIdleTimeoutRule rule = spy(new WaitForIdleTimeoutRule()); in createRule() local
110 doReturn(args).when(rule).getArguments(); in createRule()
111 doReturn(Arrays.asList(new TestableTimeoutSetter())).when(rule).getTimeoutSetters(); in createRule()
113 return rule; in createRule()
DLimitDevicesRuleTest.kt16 package android.platform.test.rule
18 import android.platform.test.rule.DeviceProduct.CF_PHONE
19 import android.platform.test.rule.DeviceProduct.CF_TABLET
42 val rule = LimitDevicesRule(thisDevice = CF_PHONE.product) in allowOnPhone_withPhone_succeeds() constant
46 assertEquals(rule.apply(statement, description), statement) in allowOnPhone_withPhone_succeeds()
51 val rule = LimitDevicesRule(thisDevice = CF_TABLET.product) in allowOnPhone_withTablet_fails() constant
55 rule.apply(statement, description).evaluate() in allowOnPhone_withTablet_fails()
60 val rule = LimitDevicesRule(thisDevice = CF_TABLET.product) in denyOnPhone_withTablet_succeeds() constant
64 assertEquals(rule.apply(statement, description), statement) in denyOnPhone_withTablet_succeeds()
69 val rule = LimitDevicesRule(thisDevice = CF_PHONE.product) in denyOnPhone_withPhone_fails() constant
[all …]
DDex2oatPressureRuleTest.java16 package android.platform.test.rule;
68 private Dex2oatPressureRule rule; field in Dex2oatPressureRuleTest
74 rule = spy(new Dex2oatPressureRule()); in setUp()
92 .when(rule) in setUp()
103 rule.apply(createTestStatement(10L), TEST_DESCRIPTION).evaluate(); in testInvokesCompilation()
104 verify(rule, times(1)).runCompileCommand(packageName, Dex2oatPressureRule.SPEED_FILTER); in testInvokesCompilation()
115 rule.apply(createTestStatement(150L), TEST_DESCRIPTION).evaluate(); in testInvokesCompilationCyclically()
117 verify(rule, atLeastOnce()) in testInvokesCompilationCyclically()
144 .when(rule) in testSchedulesCompilationUntilTestEnds()
148 rule.apply(createTestStatement(800L), TEST_DESCRIPTION).evaluate(); in testSchedulesCompilationUntilTestEnds()
[all …]
DSuspendUnsuspendAppRuleTest.java16 package android.platform.test.rule;
52 TestableSuspendUnsuspendAppRule rule = in testSuspendUnsuspendAppRule() local
55 rule.setPackageManager(mockPackageManager); in testSuspendUnsuspendAppRule()
56 rule.apply(TEST_STATEMENT, DESCRIPTION).evaluate(); in testSuspendUnsuspendAppRule()
86 TestableSuspendUnsuspendAppRule rule = in testEnableSuspendUnsuspendAppRuleTrue() local
90 rule.setPackageManager(mockPackageManager); in testEnableSuspendUnsuspendAppRuleTrue()
91 rule.apply(TEST_STATEMENT, DESCRIPTION).evaluate(); in testEnableSuspendUnsuspendAppRuleTrue()
121 TestableSuspendUnsuspendAppRule rule = in testEnableSuspendUnsuspendAppRuleFalse() local
125 rule.setPackageManager(mockPackageManager); in testEnableSuspendUnsuspendAppRuleFalse()
126 rule.apply(TEST_STATEMENT, DESCRIPTION).evaluate(); in testEnableSuspendUnsuspendAppRuleFalse()
/platform_testing/libraries/flicker/src/android/tools/flicker/junit/
DRuleContainer.kt39 fun setOrder(rule: Any, order: Int) { in setOrder()
40 orderValues[rule] = order in setOrder()
55 for (rule in methodRules) { constant in android.tools.flicker.junit.RuleContainer
56 ruleEntries.add(RuleEntry(rule, RuleEntry.TYPE_METHOD_RULE, orderValues[rule]))
58 for (rule in testRules) { constant in android.tools.flicker.junit.RuleContainer
59 ruleEntries.add(RuleEntry(rule, RuleEntry.TYPE_TEST_RULE, orderValues[rule]))
79 (ruleEntry.rule as TestRule).apply(result, description) in apply()
81 (ruleEntry.rule as MethodRule).apply(result, method, target) in apply()
95 result.add(entry.rule)
100 internal class RuleEntry(val rule: Any, val type: Int, order: Int?) { constant in android.tools.flicker.junit.RuleContainer.RuleEntry
/platform_testing/tests/health/scenarios/tests/src/android/platform/test/scenario/generic/
DOpenAppMicrobenchmark.java19 import android.platform.test.rule.CompilationFilterRule;
20 import android.platform.test.rule.DropCachesRule;
21 import android.platform.test.rule.KillAppsRule;
22 import android.platform.test.rule.PressHomeRule;
23 import android.platform.test.rule.FinishActivitiesWithoutProcessKillRule;
/platform_testing/tests/apphealth/scenarios/tests/src/android/platform/test/scenario/facebook/
DOpenAppMicrobenchmark.java19 import android.platform.test.rule.CompilationFilterRule;
20 import android.platform.test.rule.CleanPackageRule;
21 import android.platform.test.rule.DropCachesRule;
22 import android.platform.test.rule.KillAppsRule;
23 import android.platform.test.rule.PressHomeRule;
/platform_testing/libraries/flicker/test/src/android/tools/flicker/legacy/runner/
DTransitionExecutionRuleTest.kt73 val rule = createRule(listOf(runTransition)) in runSuccessfully() constant
74 rule.apply(base = null, description = Consts.description(this)).evaluate() in runSuccessfully()
81 val rule = createRule(listOf(runTransition), writer) in setTransitionStartAndEndTime() constant
82 rule.apply(base = null, description = Consts.description(this)).evaluate() in setTransitionStartAndEndTime()
91 val rule = createRule(listOf(throwTransitionError)) in throwsTransitionFailure() constant
92 rule.apply(base = null, description = Consts.description(this)).evaluate() in throwsTransitionFailure()
102 val rule = createRule(listOf()) in throwsTransitionFailureEmptyTransitions() constant
103 rule.apply(base = null, description = Consts.description(this)).evaluate() in throwsTransitionFailureEmptyTransitions()
113 val rule = createRule(listOf(throwAssertionError)) in throwsAssertionFailure() constant
114 rule.apply(base = null, description = Consts.description(this)).evaluate() in throwsAssertionFailure()
[all …]
DTraceMonitorRuleTest.kt58 val rule = createRule(listOf(monitorWithoutException)) in executesSuccessfully() constant
59 rule.apply(base = null, description = Consts.description(this)).evaluate() in executesSuccessfully()
66 val rule = createRule(listOf(monitorWithoutException, monitorWithoutException)) in executesSuccessfullyMonitor2() constant
67 rule.apply(base = null, description = Consts.description(this)).evaluate() in executesSuccessfullyMonitor2()
76 val rule = createRule(listOf(monitorWithExceptionStart)) in executesWithStartFailure() constant
77 rule.apply(base = null, description = Consts.description(this)).evaluate() in executesWithStartFailure()
88 val rule = createRule(listOf(monitorWithExceptionStart, monitorWithoutException)) in executesStartFailureMonitor2() constant
89 rule.apply(base = null, description = Consts.description(this)).evaluate() in executesStartFailureMonitor2()
100 val rule = createRule(listOf(monitorWithExceptionStop)) in executesWithStopFailure() constant
101 rule.apply(base = null, description = Consts.description(this)).evaluate() in executesWithStopFailure()
[all …]

12345678910