Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
4e4bbcc3
Commit
4e4bbcc3
authored
Feb 17, 2021
by
Oana Horvath
Browse files
For #16317: resets long press delay at the end of UI tests
parent
dfc5628c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/androidTest/java/org/mozilla/fenix/helpers/HomeActivityTestRule.kt
View file @
4e4bbcc3
...
...
@@ -27,9 +27,14 @@ class HomeActivityTestRule(
ActivityTestRule
<
HomeActivity
>(
HomeActivity
::
class
.
java
,
initialTouchMode
,
launchActivity
)
{
override
fun
beforeActivityLaunched
()
{
super
.
beforeActivityLaunched
()
setLongTapTimeout
()
setLongTapTimeout
(
"3000"
)
if
(
skipOnboarding
)
{
skipOnboardingBeforeLaunch
()
}
}
override
fun
afterActivityFinished
()
{
super
.
afterActivityFinished
()
setLongTapTimeout
(
"400"
)
}
}
/**
...
...
@@ -48,15 +53,20 @@ class HomeActivityIntentTestRule(
IntentsTestRule
<
HomeActivity
>(
HomeActivity
::
class
.
java
,
initialTouchMode
,
launchActivity
)
{
override
fun
beforeActivityLaunched
()
{
super
.
beforeActivityLaunched
()
setLongTapTimeout
()
setLongTapTimeout
(
"3000"
)
if
(
skipOnboarding
)
{
skipOnboardingBeforeLaunch
()
}
}
override
fun
afterActivityFinished
()
{
super
.
afterActivityFinished
()
setLongTapTimeout
(
"400"
)
}
}
// changing the device preference for Touch and Hold delay, to avoid long-clicks instead of a single-click
fun
setLongTapTimeout
()
{
fun
setLongTapTimeout
(
delay
:
String
)
{
val
mDevice
=
UiDevice
.
getInstance
(
InstrumentationRegistry
.
getInstrumentation
())
mDevice
.
executeShellCommand
(
"settings put secure long_press_timeout
3000
"
)
mDevice
.
executeShellCommand
(
"settings put secure long_press_timeout
$delay
"
)
}
private
fun
skipOnboardingBeforeLaunch
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment