Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base
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
Dhina17
platform_frameworks_base
Commits
8217123a
Commit
8217123a
authored
1 year ago
by
Mateusz Cicheński
Committed by
Android (Google) Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Adding test for Netflix entering PiP" into main
parents
fe9a318c
d2b8ffea
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
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
+117
-0
117 additions, 0 deletions
.../android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
with
117 additions
and
0 deletions
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/apps/NetflixEnterPipTest.kt
0 → 100644
+
117
−
0
View file @
8217123a
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.android.wm.shell.flicker.pip.apps
import
android.platform.test.annotations.Postsubmit
import
android.tools.common.NavBar
import
android.tools.common.Rotation
import
android.tools.common.traces.component.ComponentNameMatcher
import
android.tools.device.apphelpers.NetflixAppHelper
import
android.tools.device.flicker.junit.FlickerParametersRunnerFactory
import
android.tools.device.flicker.legacy.FlickerBuilder
import
android.tools.device.flicker.legacy.LegacyFlickerTest
import
android.tools.device.flicker.legacy.LegacyFlickerTestFactory
import
androidx.test.filters.RequiresDevice
import
org.junit.Assume
import
org.junit.FixMethodOrder
import
org.junit.Test
import
org.junit.runner.RunWith
import
org.junit.runners.MethodSorters
import
org.junit.runners.Parameterized
/**
* Test entering pip from Netflix app by interacting with the app UI
*
* To run this test: `atest WMShellFlickerTests:NetflixEnterPipTest`
*
* Actions:
* ```
* Launch Netflix and start playing a video
* Go home to enter PiP
* ```
*
* Notes:
* ```
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
* are inherited from [PipTransition]
* 2. Part of the test setup occurs automatically via
* [android.tools.device.flicker.legacy.runner.TransitionRunner],
* including configuring navigation mode, initial orientation and ensuring no
* apps are running before setup
* ```
*/
@RequiresDevice
@RunWith
(
Parameterized
::
class
)
@Parameterized
.
UseParametersRunnerFactory
(
FlickerParametersRunnerFactory
::
class
)
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
open
class
NetflixEnterPipTest
(
flicker
:
LegacyFlickerTest
)
:
AppsEnterPipTransition
(
flicker
)
{
override
val
standardAppHelper
:
NetflixAppHelper
=
NetflixAppHelper
(
instrumentation
)
override
val
defaultEnterPip
:
FlickerBuilder
.()
->
Unit
=
{
setup
{
standardAppHelper
.
launchViaIntent
(
wmHelper
,
NetflixAppHelper
.
getNetflixWatchVideoIntent
(
"70184207"
),
ComponentNameMatcher
(
NetflixAppHelper
.
PACKAGE_NAME
,
NetflixAppHelper
.
WATCH_ACTIVITY
)
)
standardAppHelper
.
waitForVideoPlaying
()
}
}
override
val
defaultTeardown
:
FlickerBuilder
.()
->
Unit
=
{
teardown
{
standardAppHelper
.
exit
(
wmHelper
)
}
}
override
val
thisTransition
:
FlickerBuilder
.()
->
Unit
=
{
transitions
{
tapl
.
goHomeFromImmersiveFullscreenApp
()
}
}
@Postsubmit
@Test
override
fun
pipOverlayLayerAppearThenDisappear
()
{
// Netflix uses source rect hint, so PiP overlay is never present
}
@Postsubmit
@Test
override
fun
focusChanges
()
{
// in gestural nav the focus goes to different activity on swipe up with auto enter PiP
Assume
.
assumeFalse
(
flicker
.
scenario
.
isGesturalNavigation
)
super
.
focusChanges
()
}
companion
object
{
/**
* Creates the test configurations.
*
* See [LegacyFlickerTestFactory.nonRotationTests] for configuring repetitions, screen
* orientation and navigation modes.
*/
@Parameterized
.
Parameters
(
name
=
"{0}"
)
@JvmStatic
fun
getParams
()
=
LegacyFlickerTestFactory
.
nonRotationTests
(
supportedRotations
=
listOf
(
Rotation
.
ROTATION_0
),
supportedNavigationModes
=
listOf
(
NavBar
.
MODE_GESTURAL
)
)
}
}
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