35 Commits
Author SHA1 Message Date
c4dfe19ee8 test: make DNS-failure specs independent of the network's DNS and proxy (#54941)
* test: make DNS-failure specs independent of the network's DNS and proxy

Four specs check how a failed host name lookup is reported:
net.fetch in the main process and in a utility process,
a main-frame loadURL, and a subframe failure
that must not reject the main frame's loadURL.
They used made-up public names (i.do.not.exist, err.name.not.resolved)
and relied on the machine's network to answer NXDOMAIN for them.

In a downstream Windows CI, an HTTP proxy was briefly enabled
on October 6, and every test job that ran with it failed these specs:
the https requests failed with ERR_CONNECTION_CLOSED or
ERR_CONNECTION_ABORTED instead of a lookup error,
and the http subframe never reported a failed load,
so that test timed out.
A local proxy that accepts the tunnel and then closes it,
and serves an error page for plain http,
reproduces all four failures on Linux.

Map notfound.localhost to ^NOTFOUND in the spec runner's
host-resolver-rules and use it in these specs.
Chromium fails that lookup with ERR_NAME_NOT_RESOLVED
without sending a DNS query, and proxies bypass *.localhost
by default, so the specs check the same error and subframe
behavior on any network.

This also re-enables the main-frame spec on Windows on Arm.
It was skipped for #20008, where that platform's DNS returned
ERR_NAME_RESOLUTION_FAILED; the mapped host never reaches DNS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update spec/index.js

Co-authored-by: David Babenko-Sanders <dsanders11@ucsbalum.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: David Babenko-Sanders <dsanders11@ucsbalum.com>
2026-10-14 19:55:35 -05:00
Samuel Attard 32b93bf499 test: run the spec suite with vitest (#54264)
* test: run the spec suite with vitest

Replace the in-process mocha runner with vitest driving a pool of Electron
processes.

- spec/vitest/electron-pool.ts is a vitest pool whose workers are
  'electron spec/ --vitest-worker' browser processes talking to the CLI
  over a Node IPC channel (JSON, see ipc-serialization.ts, because the
  host Node cannot read Electron's newer V8 wire format).
- spec/index.js keeps the pre-ready process setup and then hands the main
  process to vitest's worker runtime (spec/vitest/worker.ts).
  experimental.viteModuleRunner is off, so spec files are imported by
  Electron's own Node exactly as before (native ESM, type stripping, no
  Vite transform).
- spec/vitest/mocha-compat.ts provides mocha's BDD globals (describe/it/
  before/after, this.timeout()/this.skip(), done callbacks, resettable
  timeouts, hooks in declaration order, a macrotask between runnables) on
  top of vitest, so the spec files run unchanged.
- Two projects run in sequence: everything not tagged 'serial' across
  several workers, then the 'serial' suites one file at a time.
- script/spec-runner.js translates --files/-g into vitest filters, wraps
  the CLI in dbus_mock.py on Linux and reruns failures from vitest's JUnit
  report; leftover Electron processes are killed once per run
  (global-setup.js) and per worker process group.
- spec-timings.json for shard balancing comes from timings-reporter.ts;
  mocha, its reporters and ELECTRON_FORCE_TEST_SUITE_EXIT are gone.

* test: run the macOS app activation, hide and dock specs serially

app.isActive(), app.hide()/show() and the dock are machine-wide state, so
these suites cannot share the screen with other spec processes. The
isActive spec also assumed the process starts out inactive, which a
freshly launched worker on the CI hosts is not; hide first in that case.
2026-09-25 17:20:37 -07:00
Samuel Attard 5c34ec58e7 test: prepare the spec suite for a parallel runner (#54261)
* test: use describe() for spec groups that were declared with it()

A few BrowserWindow spec groups were declared with it()/ifit() but only
contain further it() calls. Mocha registered the inner tests against a
suite that had already started, so they never ran; vitest rejects the
nesting outright. Declare them as suites.

Some of the tests this brings back to life no longer match macOS: a
non-resizable window is not maximizable there, and maximizable on its own
follows fullScreenable because the zoom button doubles as the full screen
button (NativeWindowMac::UpdateZoomButton), so those expectations are
updated or kept to Windows; representedFilename comes back as an absolute
path, so the spec sets one; and the animated setBounds()/setSize()
'resized' event does not arrive on the CI hosts, so that pair stays
skipped with a FIXME.

* test: set retries on the suite instead of inside the running test

this.retries(n) from inside a test body only works in mocha, which reads
the value after the attempt fails. Move the two remaining uses up to the
enclosing describe so the retry count is known when the test is
declared.

* test: keep running defer()-ed cleanups after one of them throws

runCleanupFunctions() stopped at the first cleanup that threw and never
cleared the list, so the same stale cleanup ran, and threw, again after
every later test in the file. Drain the list up front, run every entry,
and report the collected errors once.

* test: accept an options argument between the title and body of describe/it

Lets specs write it(title, { timeout, retry, tags }, fn) and
describe(title, { ... }, fn). timeout and retry map onto mocha's per
runnable settings; tags are ignored by the mocha runner and are there so
suites can be marked for the upcoming parallel runner without a second
syntax.

* test: only reap windows that were open when closeWindow() was called

closeWindow() checks on the next tick that no other windows were left
behind and destroys any it finds. It re-read the window list at that
point, so when the next test had already created its window by then, that
window was destroyed too and the test failed with 'Object has been
destroyed'. Whether that happened depended only on how long the runner
took between afterEach and the next beforeEach.

* test: don't count unrelated webContents in the WebContentsView reuse spec

The test compared getAllWebContents().length before and after, which also
counts webContents that earlier tests left to the garbage collector and
that can be collected while this test awaits a load. Compare the sets
instead.

* test: tag the suites that need the machine to themselves as serial

Suites that depend on OS-level window focus, the system clipboard, screen
capture, global shortcuts, real mouse input or the mocked D-Bus services
cannot share the machine with other test windows. Mark them with
{ tags: ['serial'] } so a parallel runner can hold them back and run them
one at a time; the mocha runner ignores the option.

* test: don't pick up another window's visibilitychange message

The document.visibilityState specs listened for 'pong' on ipcMain, so a
late message from the previous test's page (sent as its window was torn
down) could be taken for the first report of the new window. Listen on
the window's own webContents.ipc instead.

The BrowserView variant counted visibilitychange events from page load,
which includes the freshly shown host window becoming visible when that
reaches the renderer after the load; wait for the page to report
'visible' before counting.

* test: clear the logind mock's call log before the powerMonitor specs

The specs assert exact Inhibit call counts on the python-dbusmock logind
object. That mock is started once around the whole test run, so any other
Electron process of the same run that engaged powerMonitor has already
left calls in its log. Clear it before counting.

* test: wait for focus before blurring in the BrowserWindow.focus() spec

'focuses a blurred window' called blur() straight after show(). blur()
does nothing to a window that has not become key yet, and for the first
window a process shows on macOS that trails the 'show' event, so the
'blur' the test then waited for never came. Wait for 'focus' first, as
the BrowserWindow.blur() spec next to it already does.

* test: give the utilityProcess heap snapshot spec a minute

Growing the heap to its limit and writing the snapshot is CPU bound and
does not fit in the default 30 seconds on the macOS x64 CI hosts when
other spec files run alongside it.
2026-09-23 23:55:23 -07:00
claude[bot]andClaude Opus 5.5 1042d2998b test: rename spec files from -spec.ts to .spec.ts (#54258)
* test: rename spec files from -spec.ts to .spec.ts

Renames every spec/*-spec.ts file to spec/*.spec.ts and updates the
mocha file filter in spec/index.js, the glob in script/split-tests.js,
script/spec-weights.json, the macOS and Wayland spec allowlists, and
comments/docs that refer to spec files by name, so mocha and CI shard
splitting still pick up every spec file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoGAobkKTt7KNqEiajK2Gm

* test: fail spec runs on files still named -spec.ts

The spec runner only loads *.spec.ts, so a spec file still named
*-spec.ts (for example from a PR opened before the rename) would
silently never run. spec/index.js now throws before mocha starts if
one is present in spec/, so the test jobs go red instead. This is a
temporary guard for the transition.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EoGAobkKTt7KNqEiajK2Gm

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-23 16:45:57 -07:00
Samuel AttardandClaude 9baaed782e test: load specs as native ES modules (#54171)
* test: mechanically rewrite spec imports and __dirname for native ESM

This is the automated half of loading spec/ as native ES modules and is
not expected to pass on its own; the hand-written half follows in the
next commit. A script (included in the pull request description) made
three changes to spec/*.ts and spec/lib/*.ts, then oxfmt was re-run:

* relative import specifiers gain their real file extension
* __dirname / __filename become import.meta.dirname / .filename
* files that still call require() from module code get a
  createRequire(import.meta.url) prelude

Code inside functions that are stringified and evaluated in another
process (remotely(), itremote(), template-interpolated functions and
similar) is left as it was.

* test: load specs as native ES modules with Node's type stripping

spec/package.json declares "type": "module", so the spec runner and every
spec file now load through Node's own ESM loader and built-in TypeScript
type stripping; the require.extensions transpile hook is gone. A new
spec/fixtures/package.json keeps fixtures in a CommonJS scope.

The hand-written changes on top of the mechanical rewrite:

* spec/index.js becomes an ES module and import()s its test dependencies
  after the app is ready, then uses mocha.loadFilesAsync().
* Functions that are stringified and sent to another process now arrive
  as written rather than as CommonJS transpiler output, so the
  remote-control and utility-process fixtures define the plain names
  those bodies use (chai, expect, once, setTimeout, ...) instead of the
  old `electron_1` style shims, and a few bodies require() what they use.
* The two specs that exercise lib/ sources require() them, since lib/ is
  not in a "type": "module" scope.
* spec-helpers resolves BrowserWindow lazily so it stays loadable from a
  utility process.
* tsconfig.spec.json allows .ts extension imports; spec/tsconfig.json
  points editors at it.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 15:21:31 -07:00
Samuel AttardandClaude 6e5da86c2a build: remove the ts-node dependency (#54169)
The last user of ts-node was the spec runner, which registered it as a
require hook so spec/**/*.ts could be loaded inside Electron (the
utility-process net fixture did the same).

Both now register a small local hook, spec/ts-register.js, that
transpiles each .ts file on its own with the TypeScript compiler API
using tsconfig.spec.json and inlines a source map so stack traces still
point at the .ts lines. ts-node also type checked specs as it loaded
them; that check now runs once in the lint job via
`tsc -p tsconfig.spec.json` instead, so type errors in specs fail lint
rather than surfacing part-way through a test shard.

Drops ts-node 6.2.0 and its transitive arrify, buffer-from, diff@3,
make-error, mkdirp@0.5, source-map-support and yn entries from
yarn.lock.

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 13:09:47 -07:00
claude[bot]andClaude Fable 5.1 321404e2de test: disable the GPU for macos-x64 CI apps (#53994)
* test: start macos-x64 CI apps on SwiftShader

The macos-x64 CI runners are Intel VMs without a Metal-capable GPU. Every
Electron browser process started during a test run (the spec runner itself
and each app a test spawns) launches a hardware GPU process whose ANGLE/EGL
initialization fails:

  ERROR:ui/gl/gl_display.cc:648 Initialization of all (1) EGL display types failed
  ERROR:ui/gl/gl_initializer_mac.cc:127 GLDisplayEGL::Initialize failed
  ERROR:content/gpu/viz_main_impl.cc:192 Exiting GPU process due to errors during initialization

Chromium relaunches the GPU process one to seven times before falling back
to SwiftShader, which produces roughly 2,300 such lines per macos-x64 run
and none on macos-arm64.

Pass --use-angle=swiftshader so the GPU process starts on SwiftShader
directly and skips the failed hardware launches. Spawned apps do not
inherit the runner's switches, so the switch is added in three places:

- spec/index.js appends it to the spec runner's own command line.
- spec/lib/spec-helpers.ts exports `ciGpuArgs`, used by
  startRemoteControlApp().
- spec/lib/pdf-helpers.ts passes `ciGpuArgs` to the pdf-reader fixture.

The switch is gated on CI && darwin && x64 so developers on Intel Macs
keep their real GPU. Per-test direct spawn() calls in individual spec
files are left as they are.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFucMLGyVVqSUAKXrqbaUT

* test: disable the GPU for macos-x64 CI apps instead of forcing SwiftShader

The previous commit passed --use-angle=swiftshader so the GPU process on
the macos-x64 runners would start on SwiftShader instead of failing the
hardware EGL init first. The CI run of that change showed SwiftShader's
Vulkan backend does not initialize on those VMs either:

  ERROR:ui/gl/gl_display.cc eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED

so the GPU process still exited and relaunched until Chromium fell back to
software compositing with GL disabled. On the mas,3 shard this was 19m00s
against 18m26s for the matching main run, with the ERROR line count going
from 961 to 1498: no runtime gain and more failed launches to log.

Software compositing with GL disabled is the state every process on these
runners ends up in anyway, so start there directly. The spec runner calls
app.disableHardwareAcceleration() (the same call the
ELECTRON_TEST_DISABLE_HARDWARE_ACCELERATION escape hatch uses) and the apps
spawned through startRemoteControlApp() and readPDF() receive --disable-gpu
via ciGpuArgs, since an environment variable would not reach their argv the
way the helpers are written. The gate is unchanged: CI on darwin x64 only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFucMLGyVVqSUAKXrqbaUT

* test: register child cleanup right after spawn in spec helpers

startRemoteControlApp only installed its deferred kill after the remote
app printed its listening port, and readPDF never registered one at all.
If startup stalls or PDF parsing hangs, mocha's timeout fires before the
cleanup exists and the Electron child survives into the in-job retry of
the same test. Per spec/CLAUDE.md, register the kill immediately after
spawn() and only kill a child that is still running.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFucMLGyVVqSUAKXrqbaUT

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-17 15:21:25 -07:00
Charles Kerr 6c289b2576 test: gate specs on testing bindings (#53956)
Release binaries fail specs that assume DCHECK-only context-bridge hooks
and fuse overrides. Gate these on testing binding availability, with an
opt-in runner check so testing jobs can fail instead of losing coverage.

Assisted-By: GitHub Copilot
2026-09-15 14:09:26 -07:00
Samuel Attard 8d93c43b78 build: keep CI test-shard weights per test job (#53737)
The spec weights that script/split-tests.js packs shards from were one
table per platform, so every macOS job packed from the same numbers
whether it was a darwin or MAS build, x64 or arm64, and every Linux job
did too, sanitizer or not. Those jobs differ by more than a constant
factor: MAS skips the updater and crash reporter specs (13 minutes of
Intel time), ASan slows native-heavy specs 7x and others not at all, and
arm64 runs some files at half the x64 time and others at three quarters.
Packing from a shared table left the MAS x64 shards 3 minutes uneven,
ASan 3 minutes, and macOS arm64 2 minutes.

Keep one table per job instead, keyed the way the job names its
test_artifacts_* upload (darwin_x64, mas_arm64, linux_x64_asan, ...).
CI already exports that key as ARTIFACT_KEY before the shard step, so
split-tests.js reads it there and derives the host's key elsewhere; a
job with no table falls back to the nearest one of its build type, then
to a legacy per-platform table, so the sharder keeps working on a
branch that has not regenerated yet. The generator keys tables the same
way, and spec/index.js records the sanitizer in spec-timings.json so
the generator can tell those runs apart.

Regenerated from every test artifact of run 34181277552 on main.
2026-09-09 14:16:15 +00:00
Samuel Attard 8baab8607d build: balance CI test shards by measured spec duration (#53441)
* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.
2026-09-03 11:33:14 -07:00
Samuel Attard fd01d1fc7a fix: return opaque responses from file and http protocol handlers for cross-origin no-cors requests (#52822)
The opaque tagging added for cross-origin no-cors loads is written to a
local response head that only the string/buffer/stream sinks deliver. The
file sink (asar/file loader) and the http sink (URLPipeLoader) build or
forward their own response head, dropping the tag, so a cross-origin
mode=no-cors fetch of a registerFileProtocol or registerHttpProtocol
resource was delivered as a basic, script-readable response.

Compute the opaque decision once in StartLoading and interpose a
URLLoaderClient on the file and http sinks that re-applies the opaque tag to
the head those sinks emit, matching the behaviour of the other sinks.
2026-08-16 03:55:40 -07:00
Charles Kerr fac0e68204 fix: skip current instance's child processes in Windows orphan killer (#51630)
The killOrphanedElectronProcesses beforeAll hook used wmic to find all
electron.exe processes by path, excluded only process.pid, then killed
the rest. On Windows, GPU/network/renderer helpers share the same exe
path — they were being killed as "orphans," causing repeated GPU process
crashes until Chromium fataled after 6 restarts.

Add a ParentProcessId-based descendant check (matching the existing
Linux /proc PPid walk) so child processes of the current instance are
preserved.

Followup to f9635f7 / #51476.
2026-05-18 16:44:23 -04:00
John Kleinschmidt f9635f7b3a test: make sure there are no orphaned electron processes running (#51476) 2026-05-04 20:17:52 -04:00
Samuel Attard 92f0993d94 fix: ensure corsEnabled: false protocol handlers do not work across protocols (#51152)
* fix: ensure corsEnabled: false protocol handlers do not work across protocols

Subresource requests for registered custom protocols are routed to
ElectronURLLoaderFactory via the renderer's per-scheme URLLoaderFactoryBundle
entry, which bypasses the network service's CorsURLLoaderFactory. This meant a
cross-origin page could fetch() a scheme registered with {supportFetchAPI: true}
and read the response body even when {corsEnabled: true} was not set.

Replicate CorsURLLoader::StartRequest's kCorsDisabledScheme gate in
ElectronURLLoaderFactory::CreateLoaderAndStart so cross-origin mode=cors
requests to such schemes fail before the JS handler runs, and tag cross-origin
mode=no-cors responses as opaque so the body is not script-readable while <img>
and similar subresource loads continue to work.

Re-enable the long-disabled "disallows CORS and fetch requests when only
supportFetchAPI is specified" test, add coverage for the opaque/no-cors,
same-origin, handler-not-invoked, corsEnabled-unaffected and net.fetch-unaffected
cases, and migrate spec helpers that were exercising a {supportFetchAPI: true}
scheme cross-origin to a corsEnabled scheme.

* chore: oxfmt
2026-04-20 09:34:37 -07:00
Samuel Attard 2c94aac330 build: add oxfmt for JS/TS formatting and import sorting (#50692)
* build: add oxfmt for code formatting and import sorting

Adds oxfmt as a devDependency alongside oxlint and wires it into the
lint pipeline. The .oxfmtrc.json config matches Electron's current JS
style (single quotes, semicolons, 2-space indent, trailing commas off,
printWidth 100) and configures sortImports with custom groups that
mirror the import/order pathGroups previously enforced by ESLint:
@electron/internal, @electron/*, and {electron,electron/**} each get
their own ordered group ahead of external modules.

- `yarn lint:fmt` runs `oxfmt --check` over JS/TS sources and is
  chained into `yarn lint` so CI enforces it automatically.
- `yarn format` runs `oxfmt --write` for local fix-up.
- lint-staged invokes `oxfmt --write` on staged .js/.ts/.mjs/.cjs
  files before oxlint, so formatting is applied at commit time.

The next commit applies the formatter to the existing codebase so the
check actually passes.

* chore: apply oxfmt formatting to JS and TS sources

Runs `yarn format` across lib/, spec/, script/, build/, default_app/,
and npm/ to bring the codebase in line with the .oxfmtrc.json settings
added in the previous commit. This is a pure formatting pass: import
statements are sorted into the groups defined by the config, method
chains longer than printWidth are broken, single-quoted strings
containing apostrophes are switched to double quotes, and a handful of
single-statement `if` bodies are re-wrapped and get braces added by
`oxlint --fix` to satisfy the `curly: multi-line` rule.

No behavior changes.
2026-04-12 02:03:04 -07:00
Nilay Arya 8b81bfda8f ci: log mocha retries in spec runner (#49150) 2026-02-19 11:30:46 -05:00
a65cfed500 chore: bump chromium to 146.0.7666.0 (main) (#49528)
* chore: bump chromium in DEPS to 146.0.7652.0

* fix(patch-conflict): update mas_avoid_private_macos_api_usage context for constrainFrameRect method

The upstream CL added a new constrainFrameRect:toScreen: method override to
NativeWidgetMacNSWindow as part of headless mode window zoom implementation.
The MAS patch's #endif for frameViewClassForStyleMask now correctly appears
after that method, since constrainFrameRect is a public API override that
doesn't need to be guarded.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7487666

* fix(patch-conflict): update printing.patch for base::DictValue rename

Updated printing.patch to use the new base::DictValue type name instead of
base::Value::Dict following Chromium's type renaming change. This affects
CompleteUpdatePrintSettings() signature and related code.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* fix(patch-conflict): update accessibility_ui patch for base::DictValue/ListValue rename

Updated adjust_accessibility_ui_for_electron.patch to use the new
base::DictValue and base::ListValue type names instead of base::Value::Dict
and base::Value::List following Chromium's type renaming change.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* chore: update patches

* 6625736: Rename DURABLE_STORAGE to PERSISTENT_STORAGE for consistency | https://chromium-review.googlesource.com/c/chromium/src/+/6625736

* chore: bump chromium in DEPS to 146.0.7653.0

* chore: update patches

* 7000847: add type tag to v8::External for gin_helper function templates

The upstream gin function templates now use v8::ExternalPointerTypeTag
for type safety when using v8::External. Updated Electron's forked
gin_helper function template to use the same kGinInternalCallbackHolderBaseTag
that Chromium's gin uses.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* fix(patch-update): extend V8 Object API deprecation patch for Node.js

Extended the existing patch to cover additional files that use
GetAlignedPointerFromInternalField and SetAlignedPointerInInternalField:
- src/stream_base-inl.h
- src/udp_wrap.cc
- src/js_udp_wrap.cc
- src/node_process_methods.cc
- src/node_snapshotable.cc
- src/base_object.cc

These APIs now require an EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* 7000847: add type tag to v8::External calls in shared_texture

Updated v8::External::New and v8::External::Value calls to use the
kExternalPointerTypeTagDefault tag as required by the V8 API change
that deprecates the tagless versions.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* 7508687: use ChildProcessId for file permission APIs

The ChildProcessSecurityPolicy::CanReadFile and GrantReadFile APIs
now require ChildProcessId instead of int. Updated to use GetID()
instead of GetDeprecatedID() for these specific calls.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7508687

* 7000847: add type tag to v8::External calls in callback and osr_converter

The v8::External API now requires an EmbedderPointerTypeTag parameter
for both New() and Value() methods to improve V8 sandbox type safety.

Updated calls in:
- callback.cc: TranslatorHolder constructor and CallTranslator
- osr_converter.cc: OffscreenSharedTextureValue converter

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7000847

* fixup! 7087956: [api] Promote deprecation of v8::Context and v8::Object API methods

Extended the Node.js patch to cover histogram.cc which also uses
SetAlignedPointerInInternalField and GetAlignedPointerFromInternalField
APIs that now require the EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* chore: bump chromium in DEPS to 146.0.7655.0

* chore: update patches

* 7509043: update WebSpellingMarker type for API change

The upstream Chromium API changed - WebSpellingMarker was moved from a
nested type within WebTextCheckClient to a standalone type in the blink
namespace.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509043

* 7498491: update process_id to use OriginatingProcess type

The upstream Chromium API changed - URLLoaderFactoryParams::process_id
was changed from an integer to a union type network::OriginatingProcess
that distinguishes between browser and renderer processes.

- For browser process requests, use OriginatingProcess::browser()
- For renderer process lookups, check !is_browser() and use
  renderer_process().value() to get the child_id

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7498491

* 5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception | https://chromium-review.googlesource.com/c/chromium/src/+/5710330

5710330 added a new NSNextStepFrame interface extension and
implementations for NativeWidgetMacNSWindowTitledFrame and
NativeWidgetMacNSWindowBorderlessFrame. These use private macOS APIs
that are not available in Mac App Store builds.

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7661.0

* chore: bump chromium in DEPS to 146.0.7663.0

* fix(patch-conflict): update accessibility_ui for string_view API change

Upstream removed redundant std::string(default_api_type) conversion as part
of a string_view optimization cleanup. Updated patch context to match.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7514107

* fix(patch-conflict): update service process launch options for sandbox API refactor

Upstream removed content/common/sandbox_init_win.cc and
content/public/common/sandbox_init_win.h, moving the functionality directly
into ChildProcessLauncherHelper. Updated patch to call
sandbox::policy::SandboxWin::StartSandboxedProcess directly with the
LaunchOptions pointer instead of going through the removed helper.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7528253

* fix(patch-conflict): update MAS safestorage for keychain API refactor

Upstream refactored KeychainPassword::GetPassword() to use a new
GetPasswordImpl() helper function with improved error tracking via
base::expected<std::string, OSStatus>. Adapted patch to use the new
GetPasswordImpl with the suffixed account name and handle migration
from legacy accounts through the new API.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7516438

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7663.0

* fix: base::Value::Dict -> base::DictValue
https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: include new cookie exclusion reason
https://chromium-review.googlesource.com/c/chromium/src/+/7486527

* fix: enable libc++ ABI flag for trivially copyable std::vector<bool>

Required for changes introduced in the following CL
https://chromium-review.googlesource.com/c/chromium/src/+/7513653

* fixup! fix: base::Value::Dict -> base::DictValue https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: spellcheck not working in tests
https://chromium-review.googlesource.com/c/chromium/src/+/7452579

* fix: cookie test failing due to multiple rejection reasons
https://chromium-review.googlesource.com/c/chromium/src/+/7506629

* fix: macos sizing unmaximized window incorrectly
https://chromium-review.googlesource.com/c/chromium/src/+/7487666

Changes to headless mode caused the unmaximized window to subtract
the height of the menubar.

* fix: skip tests for incompatible BoringSSL ML-DSA crypto
https://boringssl-review.googlesource.com/c/boringssl/+/84929

* test: fix pseudonymization registration in utility process on Linux

Ref: 7486913: Pass pseudonymization salt via shared memory at process launch | https://chromium-review.googlesource.com/c/chromium/src/+/7486913

* fix: restore MAS patch-outs

Restores some `#if !IS_MAS_BUILD()` gates dropped in 773054ad59

* fixup! 7508687: use ChildProcessId for file permission APIs

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

* chore: add note about parallel upstream change

* fixup! Merge remote-tracking branch 'origin/main' into roller/chromium/main

* Revert "fixup! 7508687: use ChildProcessId for file permission APIs"

This reverts commit 05c43e4e5d.

The _impl version has the signature, but not the public interface. :oof:

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Samuel Maddock <samuelmaddock@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
2026-02-12 12:37:56 -05:00
5d5e672f17 chore: bump chromium to 141.0.7361.0 (main) (#48054)
* chore: bump chromium in DEPS to 141.0.7352.0

* chore: update patches

* 6830573: Revert 'Migrate WrappableWithNamedPropertyInterceptor to gin::Wrappable' | https://chromium-review.googlesource.com/c/chromium/src/+/6830573

* chore: bump chromium in DEPS to 141.0.7354.0

* chore: bump chromium in DEPS to 141.0.7356.0

* chore: bump chromium in DEPS to 141.0.7357.0

* chore: bump chromium in DEPS to 141.0.7359.0

* chore: bump chromium in DEPS to 141.0.7361.0

* 6838518: [Mac] Correctly deallocate sandbox error buffers and prevent crash resulting from nullptr assignment | https://chromium-review.googlesource.com/c/chromium/src/+/6838518

* 6850973: Reland "Use base::ByteCount in base::SysInfo." | https://chromium-review.googlesource.com/c/chromium/src/+/6850973

* 6506565: [FPF-CI] Create initial NoiseHash in the browser. | https://chromium-review.googlesource.com/c/chromium/src/+/6506565

* chore: update patches

* fixup! 6850973: Reland "Use base::ByteCount in base::SysInfo." | https://chromium-review.googlesource.com/c/chromium/src/+/6850973

* fixup! 6506565: [FPF-CI] Create initial NoiseHash in the browser. | https://chromium-review.googlesource.com/c/chromium/src/+/6506565

* fix: unsafe buffer warning in fix_properly_honor_printing_page_ranges.patch

* fix: FTBFS in src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch

This change should be upstreamed.

Fixes this error:

../../third_party/electron_node/src/env.cc:606:3: error: no matching function for call to 'Wrap'
  606 |   v8::Object::Wrap<v8::CppHeapPointerTag::kDefaultTag>(
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../v8/include/v8-object.h:1076:14: note: candidate function template not viable: cannot convert argument of incomplete type 'void *' to 'v8::Object::Wrappable *' for 3rd argument
 1076 | void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
      |              ^
 1077 |                   v8::Object::Wrappable* wrappable) {
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../v8/include/v8-object.h:1084:14: note: candidate function template not viable: no known conversion from 'Local<Object>' to 'const PersistentBase<Object>' for 2nd argument
 1084 | void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
      |              ^                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../v8/include/v8-object.h:1093:14: note: candidate function template not viable: no known conversion from 'Local<Object>' to 'const BasicTracedReference<Object>' for 2nd argument
 1093 | void Object::Wrap(v8::Isolate* isolate,
      |              ^
 1094 |                   const BasicTracedReference<Object>& wrapper,
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

* [v8-init] Access crash key only from main thread | https://chromium-review.googlesource.com/c/chromium/src/+/6827167

* chore: e patches all

* chore: remove chore_restore_some_deprecated_wrapper_utility_in_gin.patch from patches

this remove line got re-added when rebasing roller/chromium/main

* chore: e patches all

* fix: include base/time/time.h when using base::Time

* chore: update patches

* Make --host-rules an alias for --host-resolver-rules.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4867872

* ci: update BUILD_TOOLS_SHA

Refs https://github.com/electron/build-tools/pull/746

* [Fontations] Remove Fontations suffix from font names

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6835930

* temp: debug macOS addon build failure

* Revert "temp: debug macOS addon build failure"

This reverts commit 40bc8abab65dc83e17c4ab97cb6e7522a193fb44.

* test: run tests with Xcode 16.4

* ci: fix tccdb update for macOS 15

* spec: disable opening external application for loadURL

on macOS opening unknown external application will bring
up dialog to choose apps from application store which will
break our other test suites that want to capture screen
for pixel matching.

The loadURL spec that tests bad-scheme://foo is sufficient
that we hit the permission handler for openExternal since
at that point we already know the runtime gave up on handling
the scheme.

* chore: rebase patches

* chore: disable codesiging tests

* ci: update ScreenCaptureApprovals.plist for /bin/bash

* ci: try updating tcc permissions

* ci: update TCC permissions

Refs https://www.rainforestqa.com/blog/macos-tcc-db-deep-dive

* chore: test with 1st quadrant of the window

* chore: adjust for macOS 15 menubar height

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-08-29 12:31:47 +09:00
be1a3dce83 build: use github actions for windows (#44136)
* build: test windows runner

* build: try build windows on windows?

* build: take win/cross changes

* build: use bash as default shell always

* build: configure git for windows build tools

* build: bash as default

* build: configure windows correctly

* build: use sha1sum

* build: force windows cipd init and python3 existence

* just pain

* build: restore cache on windows

* build: use build-tools gclient

* build: sync gclient vars to build windows job

* build: output depshash for debugging

* build: past sam was a silly goose

* build: depshash logging

* build: force lf endings for lock and DEPS

* build: platform strings are hard

* build: checkout on windows host

* sup

* no check

* idk

* sigh

* ...

* no double checkout

* build: yolo some stuff

* build: run gn-check for windows on linux hosts for speed

* use container...

* cry ?

* build: e d

* e d

* no log

* fix toolchain on windows cross check

* build: use powershell to add mksnapshot_args

* build: enable x86 and arm64 windows builds too

* clean up

* maybe not needed

* build: keep action around for post step

* build: configure git global on win

* build: ia32 zip manifest

* build: no patch depot_tools for tests

* build: get arm64 windows closer to working

* build: windows tar is ass

* 32 bit on 32 bit

* maybe bash

* build: set up nodejs

* correct windows sharding

* fix some spec runner stuff

* fix windows tests

* overwrite -Force

* sigh

* screen res

* wat

* logs

* ... more logs

* line endings will be the death of me

* remove 1080p force thing

* vsctools + logging

* disable some fullscreen tests on GHA

* no progress

* run all CI

* install visual studio on arm64

* windows hax for non windows

* maybe arm sdk

* clean up depshash logic

* build: use single check per platform

* ensure clean args

* fix loop

* remove debug

* update default build image sha for dispatch

* plzzzz

* one more try

* arm64 vctools

* sad

* build: fix non-dispatch windows gn check

* chore: debug datadog-ci location

* chore: update build-tools for newer toolchain

* chore: set path for datadog-ci

* try this

* chore: fixup gn check

* fixup gn-check some more

* fixup windows gn check

* chore: fixup windows gn check

* test: use cmd for Windows testing

* fixup use cmd for testing on Windows

* fixup windows GN check

* fixup npm config arch for x86

* Can we set test files via powershell

* fixup to set test files via powershell

* fixup set test files via powershell

* Don't check cross instance cache disk space on Windows

* Use separate step to set env variables for testing

* fixup Use separate step to set env variables for testing

* fixup Use separate step to set env variables for testing

* fixup Use separate step to set env variables for testing (AGAIN)

* use powershell if in powershell

* fixup use powershell if in powershell

* chore: remove no longer needed changes to depot_tools

xref: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5669094
and https://chromium-review.googlesource.com/c/chromium/src/+/5844046

* chore: try using 7zip on Windows to extract tarball

* Revert "chore: try using 7zip on Windows to extract tarball"

This reverts commit c7432b6a37.

* test: debug failing tests on GHA windows

* fix: ftbfs when including simdjson in Node.js

(cherry picked from commit 48e44c40d6)

* chore: try to track down Windows testing hang

* use correct timeout

* try this

* see if this helps

* try to figure out why node is running

* shard tests to try to narrow down WOA lockup

* try to narrow down problem test

* Narrow down blocking test more

* do we need a combo to repro

* see if this cleans up the tests

* fixup navigator.usb test

* remove logging from problematic tests

* Revert "shard tests to try to narrow down WOA lockup"

This reverts commit a180658376.

* remove logging

* debug keyboard test

* add timeout for Windows since arm64 sometimes hangs

* see if this helps

* put back original timeout

* try to use screenCapture to get screenshots of what is going on on WOA

* try using electron screencapture to debug WOA hang

* chore: turn off privacy experience

* run screenshot on both shards

* fixup screencap

* try to narrow down hanging spec

* chore: cleanup servers left open

* cleanup tests

* Revert "try to narrow down hanging spec"

This reverts commit a0f959f538.

* cleanup test debugging

* fixup extensions spec

* cleanup unneeded items

* run wtf with 2 shards instead of 6

* Revert "run wtf with 2 shards instead of 6"

This reverts commit ca2d282129.

* debug windows version on woa

* dump more info

* Get detailed CPU info

* revert debugging

* use same args as AppVeyor WOA for GHA WOA

* fixup use same args as AppVeyor WOA for GHA WOA

* fixup use same args as AppVeyor WOA for GHA WOA

* try to track down which tests trigger hang

* one or more of these combinations should hang

* break up web contents spec to find hang

* further break down api-web-contents to find hang

* test: ensure all webContents are closed

* test: fix require is not defined error

* see if api-web-contents spec is now good

* test: ensure all webContents are closed

* Revert "try to track down which tests trigger hang"

This reverts commit 07298d6ffe.

* chore: use alternate location for windows toolchain

* Reapply "try to track down which tests trigger hang"

This reverts commit 0321f76d01.

* try to narrow down problem test

* fix TEST_SHARD env var

* no, really fix TEST_SHARD env var

* see if this fixes it

* test: cleanup any remaining windows and webcontents

* see if new cleanup helps

* dont destroy webcontents for now

* fixup dont destroy webcontents for now

* Only cleanup right before process.exit

* see if this fixes the hang

* actually destroy webcontents

* Revert "Reapply "try to track down which tests trigger hang""

This reverts commit cdee7de049.

* see if this helps

* Revert "see if this helps"

This reverts commit 9a15a69cf7.

* Is it all about the web contents?

* it is all about the webcontents

but which one?

* Narrow down problem webcontents test

* try to speed up git install on WOA

* disable problematic test on WOA

* remove debugging

* remove debugging from choco installs

* Revert "disable problematic test on WOA"

This reverts commit e060fb0839.

* Revert "remove debugging"

This reverts commit f18dd8b1a5.

* run against all the tests in the failing shard

* don't run visibility tests first

* remove debugging

* 3 is a magic number

* Revert "3 is a magic number"

This reverts commit 36b91ccf9f.

* match what Appveyor runs exactly

* Revert "match what Appveyor runs exactly"

This reverts commit 7260dd4322.

* chore: sort files alphabetically

* find out what spec is leaving stuff open

* chore: Checkout PR HEAD commit

 instead of merge commit

* try using app.exit instead of process.exit

* test: cleanup BrowserWindows and webContents

* Revert "chore: sort files alphabetically"

This reverts commit d9e217ffb1.

* chore: use win32 to match process.platform

Needed for build-tools to download from PRs

* chore: cache yarn dir

* fixup cache yarn

* fixup use win32 to match process.platform

* fixup use win32 to match process.platform

* fixup cache yarn

* Add debugging for WOA hang

* Add debugging for failing keyboard lock test

* Revert "Add debugging for WOA hang"

This reverts commit 8df03d568d.

* try using process.kill

* add more debugging to keyboard.lock test

* Revert "Add debugging for failing keyboard lock test"

* remove debugging

* test: disable keyboard.lock on Windows

* test: disable fullscreen tests on Windows

* test: only force test suite exit on WOA

* fixup test: only force test suite exit on WOA

* cleanup tests

* extract yarn caching/install to action

* try using bash to run windows tests

* remove left over debugging

* standardize on 'win' for Windows builds

* use 'x86' for arch for manifest files

* fixup try using bash to run windows tests

* fixup use 'x86' for arch for manifest files

* standardize on 'win' for Windows builds

* fixup use 'x86' for arch for manifest files

* fixup try using bash to run windows tests

---------

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-12-12 11:51:24 -05:00
Sam Maddock 2222920429 feat: WebFrameMain.collectJavaScriptCallStack() (#44204)
* feat: WebFrameMain.unresponsiveDocumentJSCallStack

* Revert "feat: WebFrameMain.unresponsiveDocumentJSCallStack"

This reverts commit e0612bc1a00a5282cba5df97da3c9c90e96ef244.

* feat: frame.collectJavaScriptCallStack()

* feat: frame.collectJavaScriptCallStack()

* Update web-frame-main.md
2024-12-03 13:32:24 +09:00
John Kleinschmidtandtrop[bot] 48156aee06 test: run visibility-state-spec.ts first (#44206)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2024-10-14 09:40:22 -04:00
Samuel Attard 122685194a build: add import/order eslint rule (#44085)
* build: add import/order eslint rule

* chore: run lint:js --fix
2024-10-02 19:10:44 -07:00
Charles Kerr 24d6c28b5a chore: remove walkdir dev dependency (#42591) 2024-06-21 10:31:10 -04:00
Jeremy Rose 4e8c28fdf0 fix: data corruption in protocol.handle (#41894) 2024-04-22 13:40:01 -07:00
Milan Burda 0b0707145b refactor: replace .forEach() with for-of (#39691)
* refactor: replace `.forEach()` with `for-of`

* refactor docs/fiddles/features/web-hid/renderer.js
2023-08-31 23:36:43 +09:00
Cheng Zhao cc39ddb728 test: add some environment variables for controlling tests (#39149)
chore: add some environment variables for controlling tests
2023-07-19 16:54:08 +02:00
Milan BurdaandMilan Burda d78f37ec8f refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04:00
Calvin 13be6dc8b4 test: enable CircleCI's "re-run failed tests only" feature (#38178)
* test: enable CircleCI rerun failed *tests* only

* .

* .

* console.log never fails 🤷

* normalize the filtered paths
circleci gives us a list of absolute paths here

* remove test output check
sometimes rerunning only failed tests results in some runners having
no tests to run, and thus no output

* keep relative paths the same

* error for when no tests match

* cleanup

* .
2023-05-08 17:14:59 +09:00
6bfef67aae feat: session.resolveHost (#37690)
* feat: session.resolveHost

Expose Chromium's host resolution API through the Session object.

* Update shell/browser/api/electron_api_session.cc

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* address feedback

* fix tests

* address feedback

* Add options

* Update shell/browser/api/electron_api_session.cc

Co-authored-by: Cheng Zhao <github@zcbenz.com>

* Update shell/browser/net/resolve_host_function.cc

Co-authored-by: Cheng Zhao <github@zcbenz.com>

* lint

* return object

* add missing file

* fix crash

* handle scope

* links

---------

Co-authored-by: Fedor Indutny <indutny@signal.org>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2023-04-05 10:06:14 -04:00
Calvin b8a21dbcd7 test: migrate to helpers & disabled tests list (#37513)
* test: migrate to helpers & disabled tests list

* can't disable a test suite

* correct condition

* address review comments
2023-04-04 09:48:51 -04:00
Calvin 1f390119fe test: add disabled tests list (#37334) 2023-02-28 17:27:54 -05:00
Samuel Attard 00a542358d build: only retry tests on CI (#37167) 2023-02-07 22:44:53 -08:00
Samuel Attard 6e0d63c356 build: update mocha for retries and audit fix (#37117) 2023-02-02 17:40:30 -08:00
Milan BurdaandMilan Burda 4bc6b15f53 refactor: move spec helpers to spec/lib (#37010)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-01-25 13:01:25 -08:00
Jeremy Rose db7c92fd57 test: drop now-empty remote runner (#35343)
* test: drop the now-empty remote runner from CI

* move fixtures to spec-main

* remove remote runner

* fix stuff

* remove global-paths hack

* move ts-smoke to spec/

* fix test after merge

* rename spec-main to spec

* no need to ignore spec/node_modules twice

* simplify spec-runner a little

* no need to hash pj/yl twice

* undo lint change to verify-mksnapshot.py

* excessive ..

* update electron_woa_testing.yml

* don't search for test-results-remote.xml

it is never produced now
2022-08-16 15:23:13 -04:00