Skip to content

Commit

Permalink
This fixes part of the tests
Browse files Browse the repository at this point in the history
  Broadly, the tests were broken by #7489 because there were no _startupActions. They relied on the removed codepath that assumed wt.exe always set actions, or `AppCommandlineArgs::ValidateStartupCommands` created one by default.

  These tests are still broken:
  * `TerminalAppLocalTests::TabTests::TryZoomPane [Failed]`
  * `TerminalAppLocalTests::TabTests::MoveFocusFromZoomedPane [Failed]`
  * `TerminalAppLocalTests::TabTests::CloseZoomedPane [Failed]`

  Re:#9659
  • Loading branch information
zadjii-msft committed Mar 30, 2021
1 parent 906edf7 commit 06b4168
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/cascadia/LocalTests_TerminalApp/TabTests.cpp
Expand Up @@ -257,9 +257,18 @@ namespace TerminalAppLocalTests
result = RunOnUIThread([&page]() {
VERIFY_IS_NOT_NULL(page);
VERIFY_IS_NOT_NULL(page->_settings);
// DebugBreak();
page->Create();
Log::Comment(L"Create()'d the page successfully");

// Build the NewTab action from the values we've parsed on the commandline.
NewTerminalArgs newTerminalArgs{};
NewTabArgs args{ newTerminalArgs };
ActionAndArgs newTabAction{ ShortcutAction::NewTab, args };
// push the arg onto the front
page->_startupActions.Append(newTabAction);
Log::Comment(L"Added a single newTab action");

auto app = ::winrt::Windows::UI::Xaml::Application::Current();

winrt::TerminalApp::TerminalPage pp = *page;
Expand All @@ -276,8 +285,9 @@ namespace TerminalAppLocalTests
// In the real app, this isn't a problem, but doesn't happen
// reliably in the unit tests.
Log::Comment(L"Ensure we set the first tab as the selected one.");
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
page->_tabView.SelectedItem(tab->TabViewItem());
auto tab = page->_tabs.GetAt(0);
auto tabImpl = page->_GetTerminalTabImpl(tab);
page->_tabView.SelectedItem(tabImpl->TabViewItem());
page->_UpdatedSelectedTab(0);
});
VERIFY_SUCCEEDED(result);
Expand Down

0 comments on commit 06b4168

Please sign in to comment.