wmputils

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: 19 Imported by: 0

Documentation

Overview

Package wmputils contains utility functions for wmp tests.

Package wmputils contains utility functions for wmp tests.

Package wmputils contains utility functions for wmp tests.

Package wmputils contains utility functions for wmp tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCaptureModeActivated

func EnsureCaptureModeActivated(tconn *chrome.TestConn, activated bool) uiauto.Action

EnsureCaptureModeActivated makes sure that the capture mode is activated.

func EnsureOnlyBrowserWindowOpen

func EnsureOnlyBrowserWindowOpen(ctx context.Context, tconn *chrome.TestConn, bt browser.Type) (*ash.Window, error)

EnsureOnlyBrowserWindowOpen ensures that there is only one open window that is the primary browser, and waits for the browser to be visible to avoid a race that may cause test flakiness. If there is no or more than one browser window(s) open, it throws an error.

func HasScreenRecord

func HasScreenRecord(ctx context.Context) (bool, error)

HasScreenRecord checks if any screen record file is present in Download folder.

func IsBrowserWindow

func IsBrowserWindow(w *ash.Window, bt browser.Type) bool

IsBrowserWindow returns true if it's a browser window either ash-chrome or lacros-chrome.

Types

type ResizeApp

type ResizeApp struct {
	Name         string
	ID           string
	IsArcApp     bool
	WindowFinder *nodewith.Finder
}

ResizeApp represents an app that will be resized.

func (*ResizeApp) MoveWindowToCenter

func (ra *ResizeApp) MoveWindowToCenter(tconn *chrome.TestConn, window *nodewith.Finder, isArcApp bool) uiauto.Action

MoveWindowToCenter places the window on the center of screen. Window should NOT be maximized before this function.

func (*ResizeApp) ResizeWindow

func (ra *ResizeApp) ResizeWindow(tconn *chrome.TestConn, window *nodewith.Finder, dragBound WindowBound) uiauto.Action

ResizeWindow resizes window by dragging corners/sides. SetupResizableArea should be called prior to calling this function.

func (*ResizeApp) ResizeWindowToMin

func (ra *ResizeApp) ResizeWindowToMin(tconn *chrome.TestConn, window *nodewith.Finder) uiauto.Action

ResizeWindowToMin minimizes window by dragging form top-left to bottom-right of the window.

func (*ResizeApp) TurnOffWindowPreset

func (ra *ResizeApp) TurnOffWindowPreset(ctx context.Context, cr *chrome.Chrome, tconn *chrome.TestConn) error

TurnOffWindowPreset sets the mode of ARC app from `Tablet` to `Resizable`. Non-ARC app will be ignored.

type WindowBound

type WindowBound int

WindowBound use incremental integers to represent window boundaries.

const (
	// TopLeft represents app's TopLeft corner.
	TopLeft WindowBound = iota
	// TopRight represents app's TopRight corner.
	TopRight
	// BottomLeft represents app's BottomLeft corner.
	BottomLeft
	// BottomRight represents app's BottomRight corner.
	BottomRight
	// Left represents app's Left edge.
	Left
	// Right represents app's Right edge.
	Right
	// Top represents app's Top edge.
	Top
	// Bottom represents app's Bottom edge.
	Bottom
)

func AllBounds

func AllBounds() []WindowBound

AllBounds returns all the bounds of the window.

Jump to

Keyboard shortcuts

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