Documentation
¶
Overview ¶
Package perappdensity provides functions to assist with perappdensity tast tests.
Index ¶
- Constants
- func ConfirmPixelCountInActivitySurface(ctx context.Context, cr *chrome.Chrome, a *arc.ARC, clr color.Color, ...) error
- func MeasureDisplayDensity(ctx context.Context, a *arc.ARC) (float64, error)
- func RunTest(ctx context.Context, cr *chrome.Chrome, a *arc.ARC, packageName string, ...) error
- func SetUpApk(ctx context.Context, a *arc.ARC, apk string) error
- func StartActivityWithWindowState(ctx context.Context, tconn *chrome.TestConn, a *arc.ARC, ...) (*arc.Activity, error)
- func ToggleUniformScaleFactor(ctx context.Context, a *arc.ARC, value string) error
- type Change
Constants ¶
const ( // Setprop is the path for setprop command. Setprop = "/system/bin/setprop" // Setting is the settings string for allowing density changes. Setting = "persist.sys.enable_application_zoom" // Apk is the name of the apk used in these tests. Apk = "ArcPerAppDensityTest.apk" // PackageName is the name of density application. PackageName = "org.chromium.arc.testapp.perappdensitytest" // ViewActivity is the name of view (main) activity. ViewActivity = ".ViewActivity" // UniformScaleFactor applies 1.25 scaling. UniformScaleFactor = 1.25 // UniformScaleFactorSetting string. UniformScaleFactorSetting = "persist.sys.ui.uniform_app_scaling" // Enabled is the value to enable uniform scaling. Enabled = "1" // Disabled is the value to disable uniform scaling Disabled = "0" )
Variables ¶
This section is empty.
Functions ¶
func ConfirmPixelCountInActivitySurface ¶
func ConfirmPixelCountInActivitySurface(ctx context.Context, cr *chrome.Chrome, a *arc.ARC, clr color.Color, nonScaledPixelCount int, act *arc.Activity) error
ConfirmPixelCountInActivitySurface confirms that 1.25 scaling has been correctly applied by checking the number of clr pixels drawn.
func MeasureDisplayDensity ¶
MeasureDisplayDensity initializes the display and returns its physical density.
func RunTest ¶
func RunTest(ctx context.Context, cr *chrome.Chrome, a *arc.ARC, packageName string, testSteps []Change, activity string, expectedInitialPixelCount float64) error
RunTest takes a slice of activity names and a slice of density changes and executes them.
func SetUpApk ¶
SetUpApk enables developer option for density changes, and installs the specified apk.
func StartActivityWithWindowState ¶
func StartActivityWithWindowState(ctx context.Context, tconn *chrome.TestConn, a *arc.ARC, windowState arc.WindowState, activity string) (*arc.Activity, error)
StartActivityWithWindowState starts the view activity with the specified window state. It is the responsibility of the caller to close the activity.
Types ¶
type Change ¶
type Change struct { // The action that should be performed to the current density. Name string // The corresponding key sequence to perform the action. KeySequence string // The expected pixel count after performing the current action. BlackPixelCount float64 }
Change is a struct containing information to perform density changes.