Documentation ¶
Overview ¶
Package config defines a struct to hold configurations of chrome.Chrome.
Index ¶
- Constants
- type ARCMode
- type AuthType
- type Config
- func (c *Config) ARCMode() ARCMode
- func (c *Config) ARCUseHugePages() bool
- func (c *Config) BreakpadTestMode() bool
- func (c *Config) Creds() Creds
- func (c *Config) CustomLoginTimeout() time.Duration
- func (c *Config) DMSAddr() string
- func (c *Config) DeferLogin() bool
- func (c *Config) DisableFeatures() []string
- func (c *Config) DisablePolicyKeyVerification() bool
- func (c *Config) EnableFeatures() []string
- func (c *Config) EnableFilesAppSWA() bool
- func (c *Config) EnableLoginVerboseLogs() bool
- func (c *Config) EnableRestoreTabs() bool
- func (c *Config) EncryptedReportingAddr() string
- func (c *Config) EnrollMode() EnrollMode
- func (c *Config) EnrollmentCreds() Creds
- func (c *Config) EphemeralUser() bool
- func (c *Config) ExtraArgs() []string
- func (c *Config) ExtraExtDirs() []string
- func (c *Config) ForceLaunchBrowser() bool
- func (c *Config) HideCrashRestoreBubble() bool
- func (c *Config) InstallWebApp() bool
- func (c *Config) KeepOwnership() bool
- func (c *Config) KeepState() bool
- func (c *Config) LacrosDisableFeatures() []string
- func (c *Config) LacrosEnableFeatures() []string
- func (c *Config) LacrosExtraArgs() []string
- func (c *Config) LoginMode() LoginMode
- func (c *Config) Marshal() ([]byte, error)
- func (c *Config) NormalizedUser() string
- func (c *Config) PolicyEnabled() bool
- func (c *Config) RealtimeReportingAddr() string
- func (c *Config) Region() string
- func (c *Config) RemoveNotification() bool
- func (c *Config) RestrictARCCPU() bool
- func (c *Config) SigninExtKey() string
- func (c *Config) SkipForceOnlineSignInForTesting() bool
- func (c *Config) SkipOOBEAfterLogin() bool
- func (c *Config) TryReuseSession() bool
- func (c *Config) UseSandboxGaia() bool
- func (c *Config) VKEnabled() bool
- func (c *Config) VerifySessionReuse(newCfg *Config) error
- func (c *Config) WaitForCryptohome() bool
- type Creds
- type EnrollMode
- type LoginMode
- type MutableConfig
- type Option
Constants ¶
const ( // DefaultUser contains the email address used to log into Chrome when authentication credentials are not supplied. DefaultUser = "testuser@gmail.com" // DefaultPass contains the password we use to log into the DefaultUser account. DefaultPass = "testpass" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthType ¶
type AuthType string
AuthType describes the type of authentication to be used in GAIA.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains configurations for chrome.Chrome instance as requested by options to chrome.New.
This is an immutable struct. Modification outside NewConfig is prohibited.
func (*Config) ARCUseHugePages ¶
ARCUseHugePages returns the memory mode of the guest memory.
func (*Config) BreakpadTestMode ¶
BreakpadTestMode returns whether to tell Chrome's breakpad to always write dumps directly to a hard-coded directory.
func (*Config) CustomLoginTimeout ¶
CustomLoginTimeout returns a custom timeout for login. If 0, use chrome.LoginTimeout.
func (*Config) DeferLogin ¶
DeferLogin returns whether to defer login in chrome.New. If it is true, users should call Chrome.ContinueLogin to continue login.
func (*Config) DisableFeatures ¶
DisableFeatures returns extra Chrome features to disable.
func (*Config) DisablePolicyKeyVerification ¶
DisablePolicyKeyVerification returns whether to disable policy key verification in Chrome.
func (*Config) EnableFeatures ¶
EnableFeatures returns extra Chrome features to enable.
func (*Config) EnableFilesAppSWA ¶
EnableFilesAppSWA returns true if the Files app is running the SWA variant. TODO(b/207576612): Remove this config item once Files app SWA is fully launched.
func (*Config) EnableLoginVerboseLogs ¶
EnableLoginVerboseLogs returns whether to enable verbose logs on login.
func (*Config) EnableRestoreTabs ¶
EnableRestoreTabs returns true if creating browser windows on login should be skipped.
func (*Config) EncryptedReportingAddr ¶
EncryptedReportingAddr returns the address of a encrypted reporting endpoint.
func (*Config) EnrollMode ¶
func (c *Config) EnrollMode() EnrollMode
EnrollMode returns an enterprise enrollment mode.
func (*Config) EnrollmentCreds ¶
EnrollmentCreds returns the credential used to enroll the device.
func (*Config) EphemeralUser ¶
EphemeralUser returns true if user mount should be validated to be ephemeral, e.g. for guest user.
func (*Config) ExtraExtDirs ¶
ExtraExtDirs returns directories containing extra unpacked extensions to load.
func (*Config) ForceLaunchBrowser ¶
ForceLaunchBrowser returns true if to force FullRestoreService to launch browser for telemetry tests.
func (*Config) HideCrashRestoreBubble ¶
HideCrashRestoreBubble returns true if to skip "Chrome did not shut down correctly" bubble.
func (*Config) InstallWebApp ¶
InstallWebApp returns whether to automatically install essential web apps.
func (*Config) KeepOwnership ¶
KeepOwnership returns whether to keep existing ownership of the device. This is critical for enrolled devices.
func (*Config) LacrosDisableFeatures ¶
LacrosDisableFeatures returns extra Lacros Chrome features to disable.
func (*Config) LacrosEnableFeatures ¶
LacrosEnableFeatures returns extra Lacros Chrome features to enable.
func (*Config) LacrosExtraArgs ¶
LacrosExtraArgs returns extra arguments to pass to Lacros Chrome.
func (*Config) NormalizedUser ¶
NormalizedUser returns a normalized user email.
func (*Config) PolicyEnabled ¶
PolicyEnabled returns whether to enable policy.
func (*Config) RealtimeReportingAddr ¶
RealtimeReportingAddr returns the address of a realtime reporting endpoint.
func (*Config) RemoveNotification ¶
RemoveNotification returns true if to remove all notiviations after restarting.
func (*Config) RestrictARCCPU ¶
RestrictARCCPU returns whether to restrict CPU usage of ARC in background.
func (*Config) SigninExtKey ¶
SigninExtKey returns a private key for the sign-in profile test extension.
func (*Config) SkipForceOnlineSignInForTesting ¶
SkipForceOnlineSignInForTesting returns true if online sign-in enforcement should be disabled.
func (*Config) SkipOOBEAfterLogin ¶
SkipOOBEAfterLogin returns whether to skip OOBE after login.
func (*Config) TryReuseSession ¶
TryReuseSession returns whether to try reusing a current user session.
func (*Config) UseSandboxGaia ¶
UseSandboxGaia returns true if the sandbox instance of Gaia should be used.
func (*Config) VerifySessionReuse ¶
VerifySessionReuse compares two configurations to see if they are compatible for the existing Chrome session to be re-used. This function is called when TryReuseSession option is set for the new Chrome session request. Default comparison logic is implemented here. Customized comparison logic goes to customizedReuseCheck() function .
func (*Config) WaitForCryptohome ¶
WaitForCryptohome returns whether to wait for the cryptohome mount after login.
type Creds ¶
type Creds struct { // User is the user name of a user account. It is typically an email // address (e.g. example@gmail.com). User string // Pass is the password of a user account. Pass string // GAIAID is a GAIA ID used on fake logins. If it is empty, an ID is // generated from the user name. The field is ignored on other type of // logins. GAIAID string // Contact is an email address of a user who owns a test account. // When logging in with a test account, its contact user may be // notified of a login attempt and asked for approval. Contact string // ParentUser is the user name of a parent account. It is used to // approve a login attempt when a child account is supervised by a // parent account. ParentUser string // ParentPass is the pass of a parent account. It is used to approve // a login attempt when a child account is supervised by a parent // account. ParentPass string }
Creds contains credentials to log into a Chrome user session.
func ParseCreds ¶
ParseCreds parses a string containing a list of credentials.
creds is a string containing multiple credentials separated by newlines:
user1:pass1 user2:pass2 user3:pass3 ...
type EnrollMode ¶
type EnrollMode int
EnrollMode describes how the test should enroll.
const ( NoEnroll EnrollMode = iota // do not enroll device FakeEnroll // enroll with a fake, local device management server GAIAEnroll // real network based enrollment using a real, live device management server )
Valid values for EnrollMode.
type MutableConfig ¶
type MutableConfig struct { Creds Creds `reuse_match:"true"` NormalizedUser string `reuse_match:"true"` KeepState bool `reuse_match:"false"` KeepOwnership bool `reuse_match:"true"` DeferLogin bool `reuse_match:"customized"` EnableRestoreTabs bool `reuse_match:"false"` LoginMode LoginMode `reuse_match:"customized"` TryReuseSession bool `reuse_match:"false"` EnableLoginVerboseLogs bool `reuse_match:"true"` VKEnabled bool `reuse_match:"true"` SkipOOBEAfterLogin bool `reuse_match:"false"` WaitForCryptohome bool `reuse_match:"false"` CustomLoginTimeout int64 `reuse_match:"false"` // time.Duration can not be serialized to JSON. Store duration in nanoseconds. InstallWebApp bool `reuse_match:"true"` Region string `reuse_match:"true"` PolicyEnabled bool `reuse_match:"true"` DMSAddr string `reuse_match:"true"` RealtimeReportingAddr string `reuse_match:"true"` EncryptedReportingAddr string `reuse_match:"true"` EnrollMode EnrollMode `reuse_match:"true"` EnrollmentCreds Creds `reuse_match:"true"` DisablePolicyKeyVerification bool `reuse_match:"true"` ARCMode ARCMode `reuse_match:"true"` ARCUseHugePages bool `reuse_match:"true"` RestrictARCCPU bool `reuse_match:"true"` BreakpadTestMode bool `reuse_match:"true"` ExtraArgs []string `reuse_match:"true"` LacrosExtraArgs []string `reuse_match:"true"` EnableFeatures []string `reuse_match:"true"` LacrosEnableFeatures []string `reuse_match:"true"` DisableFeatures []string `reuse_match:"true"` LacrosDisableFeatures []string `reuse_match:"true"` ExtraExtDirs []string `reuse_match:"customized"` SigninExtKey string `reuse_match:"customized"` SkipForceOnlineSignInForTesting bool `reuse_match:"true"` RemoveNotification bool `reuse_match:"true"` HideCrashRestoreBubble bool `reuse_match:"true"` ForceLaunchBrowser bool `reuse_match:"true"` EphemeralUser bool `reuse_match:"true"` EnableFilesAppSWA bool `reuse_match:"true"` UseSandboxGaia bool `reuse_match:"true"` }
MutableConfig is a mutable version of Config. MutableConfig is wrapped with Config to prevent mutation after it is returned by NewConfig.
When TryReuseSession flag is set for a new chrome session, the configuration of the new session will be checked with the existing chrome session, to see if session reuse is possible. The "reuse_match" tag defines how a field should be handled when trying to reuse the existing chrome session. It has the following values: - "false": this field doesn't have to match for reused session - "true": this field have to match for reused session - "customized": Reuse checking logic is expected to be customized in customizedReuseCheck() function. This tag must be set for every field with one of the above values. Otherwise, unit test will fail.
type Option ¶
type Option func(cfg *MutableConfig) error
Option is a self-referential function can be used to configure Chrome. See https://commandcenter.blogspot.com.au/2014/01/self-referential-functions-and-design.html for details about this pattern.