Skip to content

[macOS] Fix DeallocationTests crash with CSS 14.0.0#4477

Open
mallexxx wants to merge 3 commits intomainfrom
worktree-alex+investigate-css-14-crash
Open

[macOS] Fix DeallocationTests crash with CSS 14.0.0#4477
mallexxx wants to merge 3 commits intomainfrom
worktree-alex+investigate-css-14-crash

Conversation

@mallexxx
Copy link
Copy Markdown
Contributor

@mallexxx mallexxx commented Apr 20, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1202406491309510/task/1214067738586364
Tech Design URL: N/A
CC: N/A

Description

  • DeallocationTests.testWhenLastTabClosed_windowIsDeallocated was navigating to https://duckduckgo.com (via .duckDuckGo content) without a TestSchemeHandler, triggering the Tab.willStart() integration-test navigation guard added in Nov 2025 — replaced with data: URLs, matching the approach already used by the sibling test testWindowsDeallocation()
  • NewTabPageOmnibarActionsHandlerTests (previously a dangling file not compiled into any target) now compiles: fixed submitChat calls to include the required modelId/images parameters, corrected testViewAllAiChats_opensNewAIChatTab to use .newTab target (was .sameTab but asserting 2 tabs), and added firedPixels = [] to tearDown to satisfy the test isolation checker

Testing Steps

  • Run DeallocationTests/testWhenLastTabClosed_windowIsDeallocated in the Integration Tests target — should pass without SIGTRAP
  • Run all NewTabPageOmnibarActionsHandlerTests — all 9 tests should pass

Impact and Risks

Impact Level: Low

What could go wrong?

  • testWhenLastTabClosed_windowIsDeallocated used .duckDuckGo intentionally to test window deallocation with a "real" URL content type — replacing with data: means it no longer exercises that exact code path, but deallocation behaviour is the same regardless of URL scheme

Quality Considerations

  • Test-only change; no production code modified
  • Both test classes verified passing locally (run together in sequence to confirm test isolation)

Notes to Reviewer

The root crash: CSS 14.0.0 NTP JavaScript triggers a real https://duckduckgo.com navigation during page initialisation. Any integration test that creates a window/tab loading the NTP without a registered TestSchemeHandler will hit Tab.willStart()'s fatalError. The fix for DeallocationTests is minimal and matches the existing pattern in the same file.


Note

Low Risk
Test-only changes that adjust fixtures and expectations; minimal risk outside potential CI behavior differences due to the new data: URL loading path.

Overview
Fixes macOS integration-test instability by updating DeallocationTests.testWhenLastTabClosed_windowIsDeallocated to open windows with a data: URL instead of .duckDuckGo, avoiding real navigation side effects during CI.

Also wires NewTabPageOmnibarActionsHandlerTests into the Xcode test target and updates the tests to match current APIs (adds modelId/images args), corrects the viewAllAiChats open target to .newTab, and resets firedPixels in tearDown for test isolation.

Reviewed by Cursor Bugbot for commit 8b1fc36. Bugbot is set up for automated code reviews on this repo. Configure here.

@mallexxx mallexxx changed the title [macOS] Fix NTP integration test crash with CSS 14.0.0 [macOS] Fix DeallocationTests crash with CSS 14.0.0 Apr 20, 2026
mallexxx and others added 3 commits April 20, 2026 16:34
CSS 14.0.0 NTP JS now triggers an https:// navigation during page
initialization, hitting the integration-test navigation guard in
Tab.willStart(). Add TestSchemeHandler (http/https mock) to
NewTabPageOmnibarActionsHandlerTests, matching the pattern used
in AddressBarTests and other integration tests.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1202406491309510/task/1214067738586364

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CSS 14.0.0 NTP JS triggers a real https://duckduckgo.com navigation during
page init. testWhenLastTabClosed_windowIsDeallocated opened windows with
.duckDuckGo without a TestSchemeHandler, hitting the integration-test
navigation guard (Tab.willStart fatalError). Use data: URLs as the sibling
test testWindowsDeallocation already does.

Also revert incorrect change to NewTabPageOmnibarActionsHandlerTests.swift
(file is not compiled into any test target).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… issues

- Add missing modelId/images args to submitChat calls (signature updated)
- Fix testViewAllAiChats_opensNewAIChatTab: was passing .sameTab but asserting
  2 tabs (new tab behaviour); correct target is .newTab
- Clear firedPixels in tearDown to satisfy test isolation checker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mallexxx mallexxx force-pushed the worktree-alex+investigate-css-14-crash branch from 26de925 to 8b1fc36 Compare April 20, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant