Skip to content

Dev - #203

Merged
Mzying2001 merged 50 commits into
masterfrom
dev
Oct 26, 2026
Merged

Dev#203
Mzying2001 merged 50 commits into
masterfrom
dev

Conversation

@Mzying2001

Copy link
Copy Markdown
Owner

This pull request introduces a comprehensive browser regression test framework for the project, including new PowerShell helper scripts, improved documentation for running and building tests, and a GitHub Actions workflow for automated test execution. The main changes are grouped as follows:

1. Test Automation and CI Integration

  • Added a new GitHub Actions workflow (.github/workflows/tests.yml) to automatically build and run unit tests on pull requests targeting master and dev branches, ensuring continuous integration and early detection of issues.

2. Regression Test Framework

  • Introduced CefFlashBrowser.Tests/BrowserRegression/Environment.ps1, which sets up an isolated test environment, loads dependencies, and manages application and browser lifecycle for regression testing.
  • Added CefFlashBrowser.Tests/BrowserRegression/Helpers.ps1 containing utility functions for assertions, browser automation, UI interaction, and test orchestration, enabling robust end-to-end regression scenarios.

3. Documentation Improvements

  • Expanded AGENTS.md to clarify build and test commands, including instructions for running unit tests and browser regression checks, and provided references to further documentation for regression setup and diagnostics.
  • Updated contribution guidelines in AGENTS.md to emphasize following the project's code style and line ending conventions.

Create each browser window view model through an IoC factory with its browser instance and expose the WPF browser interface for bindings. Initialize the locator once and retain a design-time data context in XAML.
Make the browser reference read-only and require it in the view model constructor. Update the IoC factory to pass the browser directly and initialize the saved zoom level before commands.
Pass a ChromiumWebBrowser instance from the parameterless constructor so browser validation no longer rejects null before the design-mode check.
Move browser hosting, lifecycle handlers, and integrated DevTools UI into BrowserView, with address, title, zoom, and DevTools state in BrowserViewModel. Update BrowserWindow bindings and commands to use CurrentBrowser and handle browser events at the window level.
Associate browser models synchronously, tolerate repeated template notifications,
and guard commands before creation and after disposal. Restore detached DevTools
lookup and activation behavior, and remove duplicate window zoom state.

Tie view cleanup to the host Closed event and cancel pending UI callbacks during
disposal. Wait for CEF creation and close callbacks to return before destroying
the WPF parent, avoiding native crashes and shutdown deadlocks.

Add isolated STA regression checks for real WPF/CEF interactions. Validate x64
and x86 Debug builds, all 173 unit tests, and regression runs on both platforms.
Centralize the CEF-to-WPF dispatch sequence used by browser closing paths while preserving callback ordering.
Host popup, SWF player, and source windows in independent BrowserView
models to share handlers, DevTools integration, and resource cleanup.
Preserve address and file entry points, window-specific close policies,
and popup geometry while routing ordinary pages to the main browser.

Extend browser regression coverage for navigation, SWF loading, DevTools,
beforeunload decisions, and deferred, forced, and repeated shutdown.

Validation: x64 Debug solution and test project builds succeeded;
173 MSTest tests passed. The expanded browser regression completed once,
but repeated runs still encountered native CoreMessaging.dll crashes.
The original regression script also reproduced a libcef.dll access
violation, so native regression stability remains unresolved.
Resolve browser view models through transient IoC registrations and declare window bindings and browser view events in XAML.

Leave the initial browser address unset so owning windows control navigation timing. Update regression setup with the Locator resource, explicit blank-page navigation, and an initial-address assertion.
Unify browser window command inputs and update all affected XAML bindings. Read page metadata from the view model and remove the obsolete title lookup.

Update regression checks for command execution with null parameters, missing browser instances, and disposed browsers.
Centralize the repeated guards in IsBrowserReady and reuse it across five commands, preserving null, disposal, and initialization checks.
Centralize browser readiness checks and expose find operations on BrowserViewModel. Update window commands to delegate these operations and reuse the shared readiness checks.
Separate the standalone runner, environment setup, shared helpers, runtime C# test doubles, and browser scenarios into a dedicated directory. Pass shared state through an explicit context, preserve primary errors during cleanup, and document execution requirements.

Exclude runtime test doubles from MSTest compilation. Both architectures build and pass 173 unit tests each; seven failure-path probes pass and all 57 original assertion expressions are preserved. Full UI regression remains blocked by closing hangs and a native CoreMessaging crash; the original script also reproduces closing hangs.
Cache the latest address in ChromiumWebBrowser until its native parent is attached, preserve pending requests against early CEF notifications, and ignore navigation after disposal.

Remove window-specific navigation timing and use named dependency property callbacks. Extend browser regressions for navigation before hosting, superseded requests, and early closure.

Validation: x64 Debug solution build succeeded; 173 unit tests and the full browser regression suite passed.
Use OmniSharp with the Visual Studio MSBuild toolchain so design-time builds can resolve COM references and C++/CLI dependencies. Track workspace settings while keeping other VS Code files ignored.
Move favicon rendering and default SVG fallback into a templated BrowserIcon control with a bindable FaviconUrl property. Preserve address-bar spacing, theme colors, and null or empty URL fallback behavior.
Rename converter classes, source files, and resource keys for consistent naming. Update XAML references and linked test sources without changing conversion behavior.
Manage browser tabs through a read-only observable collection and source-aware window events while retaining browser and DevTools instances across selection changes.

Coordinate cancellable tab and window closing, wait for pending reload confirmation, and synchronously release all tabs during forced shutdown. Add real CEF regression coverage for selection, cancellation, initialization, and disposal.
Expose the existing tab lifecycle through a tab strip with creation,
selection, closing, scrolling and keyboard navigation. Hide tabs in
fullscreen and focus the address field for blank tabs.

Add localized new-tab page routing with foreground and background link
handling, and cover tab interactions in the WPF/CEF regression suite.
Place the tab list and new tab button in a left-aligned grid bounded by
the available strip width. This keeps the button next to the tabs while
allowing overflow scrolling, and centers it vertically in the strip.
Replace the default button template with a transparent background and
separate hover and pressed highlights. Derive the highlight color from
the theme text brush so both light and dark themes retain visible feedback.
Reduce browser chrome when only one tab is open while keeping tab creation accessible in the toolbar. Show the address favicon and adjust its padding according to the tab count.

Update browser regression checks to use the toolbar action and preserve the hidden tab strip when leaving fullscreen with one tab.
Bundle and register a new-tab SVG for the toolbar button, sized at 12 pixels. Register the icon in the isolated browser regression environment so test windows can resolve the resource.
Share indexed browser creation while keeping explicit new tabs appended. Route page requests to the position immediately after their source tab and preserve foreground and background activation behavior.

Extend browser regression checks for insertion order, background sources, and explicit new-tab commands. Validated with a Debug x64 solution build and the full browser regression suite.
Route searches and selected URLs through the source browser's page-opening
flow instead of always creating a window. Add a localized explicit new-tab
action that overrides the default setting while retaining auxiliary-window
routing and existing fullscreen and disposal checks.

Cover all page settings, menu composition, translations, closed-browser
callbacks, and auxiliary windows in browser regressions.

Validation: Debug|x64 solution build and full browser regression suite.
Expose ShowTabStrip on the window view model and notify it when tabs are added, removed, or reset. Bind tab strip visibility and single-tab toolbar styling to this shared state.
Add a persisted setting, disabled by default, to keep the tab bar visible with a single tab. Refresh all open browser windows immediately when it changes while preserving fullscreen hiding.

Add localized labels for all nine languages and regression coverage for settings compatibility, toolbar layout, multiple windows, and fullscreen transitions.
Reorder tabs during mouse dragging and scroll overflowing headers at the edges while preserving browser and DevTools state. Respect drag thresholds and close-button gestures, and clean up the drag timer when the gesture ends.

Add browser regression coverage for tab movement, edge scrolling, retained state, keyboard navigation, and closing reordered tabs.
Display a snapshot of the dragged header with an outline and shadow, dim its current position, and replace the default move cursor. Let the preview pass native input through and release it when dragging ends.
Rendering a tab container directly includes its horizontal layout offset, placing later headers outside the preview bitmap. Capture the template root at its local origin so every tab retains visible preview content.

Add regression checks for preview pixels in the first, second, and third tabs, after reordering, and after horizontal scrolling.
Use the resolved image source to select the default icon when loading or decoding fails, and restore the favicon when a valid source is available. Remove the unused page.png asset and resource declaration.
Recalculate the offset after status content becomes visible and finishes loading. Compensate both interval boundaries for the existing offset to prevent position oscillation and flickering over links.

Add browser regression coverage for repeated updates and redisplay inside and outside the cursor interval. Supply the missing close icon resource in the regression environment.
Add localized tab menus for closing, closing other tabs, duplicating, and opening in a new window. Bind Ctrl+Shift+K to duplicate the current tab beside its source.

Close other tabs sequentially through the existing confirmation flow, stopping on cancellation or interruption. Extend browser regression coverage for menu targeting, translations, shortcuts, and batch lifecycle. Validated with a Debug x64 solution build and 447 browser regression assertions.
@Mzying2001
Mzying2001 merged commit ee9ceb8 into master Oct 26, 2026
1 check passed
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