Files
Casey OcchialiniandClaude Fable 5 645bb46353 test(cmcd): Fix "globalThis is not defined" errors on Tizen (#10308)
## Problem

The CMCD test suites fail on Tizen with `ReferenceError: globalThis is
not defined`.

The CML test helpers vendored in #10060 reference `globalThis`, which
requires Chromium 71+. Tizen devices run Chromium <= 69, and karma's
babel pipeline cannot cover for it: babel only transpiles syntax, and
`@babel/polyfill` (core-js@2) predates `globalThis`, so the bare
identifier reaches the device unmodified and throws.

## Fix

Replace `globalThis` with `window` in the vendored test helpers
(`create_fetch_transport.js`, `create_xhr_transport.js`) and the
integration suite (`cmcd_integration.js`). They are the same object in
browsers, `window` exists on every supported device, and this matches
the existing pattern in `jasmine_fetch.js` and `HttpFetchPlugin`.
Comments at the swap sites and in `SUMMARY.txt` document the intentional
divergence from the upstream CML source so future version bumps don't
silently reintroduce it.

Production code is unaffected: `lib/` and `third_party/cml-cmcd/` never
referenced `globalThis`. Test-only change.

## Verification

- No `globalThis` code references remain anywhere karma serves (only
explanatory comments).
- All 77 CMCD tests pass in Chrome through the default babel pipeline
(the same transpile path Tizen uses).
- Scanned the vendored dirs for other post-Chromium-69 APIs: `flatMap`
in `merge_validation_results.js` is covered by `@babel/polyfill`, and no
`URLSearchParams`/`TextEncoder`/`Object.fromEntries`/`replaceAll` usage
exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-12 10:07:34 -07:00
..
2026-01-21 14:08:36 +01:00