Fix TerminalApp local tests after FRE deferral - #552
Open
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
Open
Fix TerminalApp local tests after FRE deferral#552Gordon Lam (yeelam-gordon) wants to merge 1 commit into
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
Conversation
Run tab behavior tests with the first-run experience temporarily marked complete so startup creates the expected initial tab, then restore the original application state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50b8acf2-0ef6-4e57-b95a-c92eb1f05054
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes TerminalAppLocalTests::TabTests failures caused by TerminalPage deferring initial tab creation while the first-run experience (FRE) is active, by initializing the test TerminalPage in an explicit post-FRE state and then restoring the prior FRE completion flag.
Changes:
- Temporarily sets
ApplicationState::AgentFreCompleted(true)while initializing aTerminalPageinTabTests::_initializeTerminalPage. - Restores the previous
AgentFreCompletedvalue after initialization completes.
Comment on lines
+232
to
+237
| const auto applicationState = ApplicationState::SharedInstance(); | ||
| const auto agentFreCompleted = applicationState.AgentFreCompleted(); | ||
| applicationState.AgentFreCompleted(true); | ||
| const auto restoreAgentFreCompleted = wil::scope_exit([&]() { | ||
| applicationState.AgentFreCompleted(agentFreCompleted); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgentFreCompletedvalue after page initializationTabTestsfailures caused by FRE intentionally deferring initial tab creationRoot cause
TerminalPagenow defers startup actions while the first-run experience is active. The local tab tests waited forInitializedand then assumed the first tab existed, sopage->_tabs.GetAt(0)threw0x8000FFFF. These tests exercise normal tab behavior rather than onboarding, so the helper now temporarily marks FRE complete while initializing the page.Validation
TerminalAppLocalTests::TabTests: 21/21 passedAll executed unit tests pass. Please sign off on the fix.