ChromeAppTarget class final

Bring-up for a Chrome/Chromium target in web scenarios.

Mirrors BinaryAppTarget's philosophy one surface up: own the process (fixed debug port, isolated user-data-dir, explicit lifecycle), publish the endpoint, and let the protocol client (universal_browser_cdp) attach to it. Chrome never speaks the Dart VM service, so this target produces a LaunchedChrome — not a LaunchedApp; the observe/act/verify loop runs through LaunchedChrome.driver over CDP instead of toolkit extensions.

The compile step is deliberately absent: serve the web build (or any URL) yourself and point ChromeAppTarget.startUrl at it. This type does not implement AppTarget on purpose — scenarios that mix app and browser targets compose the two handles explicitly.

Constructors

ChromeAppTarget({required int port, String? binary, bool headless = true, Uri? startUrl, int windowWidth = 1365, int windowHeight = 768, String? userDataDir, List<String> extraArgs = const ['--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-renderer-backgrounding']})

Properties

binary → String?
Chrome executable; defaults to the macOS install path, then PATH.
final
extraArgs → List<String>
Extra Chromium switches prepended to the launch args; defaults to the background-throttling disables every automation target needs.
final
hashCode → int
The hash code for this object.
no setterinherited
headless → bool
final
port → int
Fixed CDP debug port. A fixed port keeps the reuse story simple: a port already answering CDP is adopted as a borrowed session and never killed (oka's borrowed-lease rule).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startUrl → Uri?
final
userDataDir → String?
Isolated profile directory; a temp dir when omitted.
final
windowHeight → int
final
windowWidth → int
final

Methods

launch({bool build = false}) → Future<LaunchedChrome>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited