Documentation
¶
Overview ¶
Package lacrosfixt contains tools for working with lacros fixtures.
Index ¶
Constants ¶
const LacrosDeployedBinary = "lacrosDeployedBinary"
LacrosDeployedBinary contains the Fixture Var necessary to run lacros. This should be used by any lacros fixtures defined outside this file. TODO(crbug.com/1319732): Remove this after existing infra is migrated to use lacros.deployedBinary.
const LacrosLogPath = "/home/chronos/user/lacros/lacros.log"
LacrosLogPath is where the lacros log file ought to be. N.B. If lacros is launched multiple times (via command line launch, the current default), then this logfile will be overwritten. Launching means starting a new lacros process entirely, not just creating a new window or tab.
const (
// LacrosSquashFSPath indicates the location of the rootfs lacros squashfs filesystem.
LacrosSquashFSPath = "/opt/google/lacros/lacros.squash"
)
Variables ¶
This section is empty.
Functions ¶
func ExtensionArgs ¶
ExtensionArgs returns a list of args needed to pass to a lacros instance to enable the test extension.
func NewComposedFixture ¶
func NewComposedFixture(selection lacros.Selection, makeValue func(v FixtValue, pv interface{}) interface{}, fOpt chrome.OptionsCallback) testing.FixtureImpl
NewComposedFixture is similar to NewFixture but allows tests to customise the FixtValue used. This lets tests compose fixtures via struct embedding.
func NewFixture ¶
func NewFixture(selection lacros.Selection, fOpt chrome.OptionsCallback) testing.FixtureImpl
NewFixture creates a new fixture that can launch Lacros chrome with the given selection and Chrome options.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds runtime vars or other variables needed to set up Lacros.
func NewConfigFromState ¶
func NewConfigFromState(s TestingState, ops ...Option) *Config
NewConfigFromState creates a new LacrosConfig instance. TestingState allows both testing.FixtState and testing.State to be passed in. TODO(crbug.com/1319732): Remove this after existing infra is migrated to use lacros.deployedBinary.
type FixtValue ¶
The FixtValue object is made available to users of this fixture via:
func DoSomething(ctx context.Context, s *testing.State) { d := s.FixtValue().(lacros.FixtValue) ... }
type Option ¶
type Option func(*Config)
Option is the function signature used to specify options of Config.
func ChromeOptions ¶
ChromeOptions returns an Option which appends the given chrome.Options to lacros.Config. The options will be returned in lacros.Config.Opts.
func EnableWebAppInstall ¶
func EnableWebAppInstall() Option
EnableWebAppInstall returns whether to automatically install essential web apps on Lacros.
type TestingState ¶
TestingState is a mixin interface that allows both testing.FixtState and testing.State to be passed into NewConfigFromState.