Documentation
¶
Overview ¶
Package lacrosperf implements a library used for utilities for running perf tests with lacros.
Index ¶
- Constants
- type CleanupCallback
- func CombineCleanup(ctx context.Context, existing, new func(context.Context) error, msg string) CleanupCallback
- func SetupCrosTestWithPage(ctx context.Context, cr *chrome.Chrome, url string, ...) (*chrome.Conn, CleanupCallback, error)
- func SetupLacrosTestWithPage(ctx context.Context, cr *chrome.Chrome, url string, ...) (retConn *chrome.Conn, retTConn *chrome.TestConn, retL *lacros.Lacros, ...)
- func SetupPerfTest(ctx context.Context, tconn *chrome.TestConn, name string) (retCleanup CleanupCallback, retErr error)
- type StabilizeCondition
Constants ¶
const ( // StabilizeBeforeOpeningURL indicates that we should wait for e.g. CPU stability // before opening the URL. Use this if your page actively uses resources, i.e. the CPU // could not reach stability while your page is open. StabilizeBeforeOpeningURL = iota // StabilizeAfterOpeningURL indicates that we should wait for e.g. CPU stability // after opening the URL. Use this if your page is relatively static and CPU stability // can be reached. This option is preferable, if possible. StabilizeAfterOpeningURL )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupCallback ¶
CleanupCallback is a callback that should be deferred to clean up test resources.
func CombineCleanup ¶
func CombineCleanup(ctx context.Context, existing, new func(context.Context) error, msg string) CleanupCallback
CombineCleanup combines two CleanupCallbacks so they are executed in the same order that they would be if they had been deferred.
func SetupCrosTestWithPage ¶
func SetupCrosTestWithPage(ctx context.Context, cr *chrome.Chrome, url string, stabilize StabilizeCondition) (*chrome.Conn, CleanupCallback, error)
SetupCrosTestWithPage opens a cros-chrome page after waiting for a stable environment (CPU temperature, etc).
func SetupLacrosTestWithPage ¶
func SetupLacrosTestWithPage(ctx context.Context, cr *chrome.Chrome, url string, stabilize StabilizeCondition) ( retConn *chrome.Conn, retTConn *chrome.TestConn, retL *lacros.Lacros, retCleanup CleanupCallback, retErr error)
SetupLacrosTestWithPage opens a lacros-chrome page after waiting for a stable environment (CPU temperature, etc).
func SetupPerfTest ¶
func SetupPerfTest(ctx context.Context, tconn *chrome.TestConn, name string) (retCleanup CleanupCallback, retErr error)
SetupPerfTest sets up a stable environment for a lacros performance test. The returned CleanupCallback should be deferred to be executed upon test completion.
type StabilizeCondition ¶
type StabilizeCondition int
StabilizeCondition describes what condition to use in lacros perftests to stabilize the environment.