Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
366068df
Commit
366068df
authored
1 year ago
by
Lee Shombert
Committed by
Android (Google) Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Make AnrTimerTest.testDumpOutput hermetic" into main
parents
e6e4aae7
7b8808b6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java
+8
-5
8 additions, 5 deletions
...vicestests/src/com/android/server/utils/AnrTimerTest.java
with
8 additions
and
5 deletions
services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java
+
8
−
5
View file @
366068df
...
...
@@ -147,7 +147,7 @@ public class AnrTimerTest {
final
int
n
=
4
;
StackTraceElement
[]
stack
=
Thread
.
currentThread
().
getStackTrace
();
if
(
stack
.
length
<
n
+
1
)
return
"test"
;
return
stack
[
n
].
getMethodName
();
return
stack
[
n
].
getClassName
()
+
"."
+
stack
[
n
].
getMethodName
();
}
}
...
...
@@ -318,8 +318,11 @@ public class AnrTimerTest {
public
void
testDumpOutput
()
throws
Exception
{
if
(!
AnrTimer
.
nativeTimersSupported
())
return
;
// The timers in this class are named "class.method".
final
String
timerName
=
"timer: com.android.server.utils.AnrTimerTest"
;
String
r1
=
getDumpOutput
();
assertThat
(
r1
).
doesNotContain
(
"
timer
:"
);
assertThat
(
r1
).
doesNotContain
(
timer
Name
);
Helper
helper
=
new
Helper
(
2
);
TestArg
t1
=
new
TestArg
(
1
,
1
);
...
...
@@ -333,14 +336,14 @@ public class AnrTimerTest {
String
r2
=
getDumpOutput
();
// There are timers in the list if and only if the feature is enabled.
if
(
mEnabled
)
{
assertThat
(
r2
).
contains
(
"
timer
:"
);
assertThat
(
r2
).
contains
(
timer
Name
);
}
else
{
assertThat
(
r2
).
doesNotContain
(
"
timer
:"
);
assertThat
(
r2
).
doesNotContain
(
timer
Name
);
}
}
String
r3
=
getDumpOutput
();
assertThat
(
r3
).
doesNotContain
(
"
timer
:"
);
assertThat
(
r3
).
doesNotContain
(
timer
Name
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment