windowarrangementcuj

package
v0.0.0-...-9474aff Latest Latest
Warning

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

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

Documentation

Overview

Package windowarrangementcuj contains helper util and test code for WindowArrangementCUJ.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drag

func Drag(ctx context.Context, tconn *chrome.TestConn, pc pointer.Context, p DragPoints, duration time.Duration) error

Drag does the specified drag based on the documentation of DragPoints.

func RunClamShell

func RunClamShell(ctx, closeCtx context.Context, tconn *chrome.TestConn, ui *uiauto.Context, pc pointer.Context, act *arc.Activity, withTestVideo arc.ActivityStartOption) error

RunClamShell runs window arrangement cuj for clamshell. We test performance for resizing window, dragging window, maximizing window, minimizing window and split view resizing.

func RunTablet

func RunTablet(ctx, closeCtx context.Context, tconn *chrome.TestConn, ui *uiauto.Context, pc pointer.Context, act *arc.Activity, withTestVideo arc.ActivityStartOption) error

RunTablet runs window arrangement cuj for tablet. Since windows are always maximized in tablet mode, we only test performance for tab dragging and split view resizing.

Types

type Connections

type Connections struct {
	// Chrome interacts with the currently-running Chrome instance via
	// the Chrome DevTools protocol:
	// https://chromedevtools.github.io/devtools-protocol/
	Chrome *chrome.Chrome

	// Source is used to create new chrome.Conn connections.
	Source ash.ConnSource

	// TestConn is a connection to ash chrome.
	TestConn *chrome.TestConn

	// Cleanup resets everything to a clean state. It only needs to be
	// called if SetupChrome succeeds.
	Cleanup func(ctx context.Context) error

	// CloseBlankTab closes the blank tab that is created when lacros
	// is started.
	CloseBlankTab func(ctx context.Context) error

	// BrowserTestConn is a connection to ash chrome or lacros chrome,
	// depending on the browser in use.
	BrowserTestConn *chrome.TestConn

	// PipVideoTestURL is the URL of the PIP video test page.
	PipVideoTestURL string

	// ARC holds resources related to the ARC session.
	ARC *arc.ARC

	// ArcVideoActivity is an ARC activity that plays a video, looped.
	// If you minimize it, it plays the video in PIP.
	ArcVideoActivity *arc.Activity

	// WithTestVideo provides the test video URI to ArcVideoActivity.
	WithTestVideo arc.ActivityStartOption
}

Connections holds things that facilitate interaction with the DUT.

func SetupChrome

func SetupChrome(ctx, closeCtx context.Context, s *testing.State) (*Connections, error)

SetupChrome creates ash-chrome or lacros-chrome based on test parameters.

type DragPoints

type DragPoints [3]coords.Point

DragPoints holds three points, to signify a drag from the first point to the second point, then the third point, and back to the first point.

type TestParam

type TestParam struct {
	BrowserType browser.Type
	Tablet      bool
	Tracing     bool
	Validation  bool
}

TestParam holds parameters of window arrangement cuj test variations.

Jump to

Keyboard shortcuts

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