lacrosperf

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package lacrosperf implements a library used for utilities for running perf tests with lacros.

Index

Constants

View Source
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

type CleanupCallback func(context.Context) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL