Skip to content

Commit

Permalink
I this restores the functionality of the local winrt objects, not XAML
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Dec 2, 2019
1 parent 65f10e9 commit b392ba0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
6 changes: 5 additions & 1 deletion src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ namespace TerminalAppLocalTests
// If you want to do anything XAML-y, you'll need to run your test in a
// packaged context. See TabTests.cpp for more details on that.
BEGIN_TEST_CLASS(SettingsTests)
TEST_CLASS_PROPERTY(L"ActivationContext", L"TerminalApp.LocalTests.manifest")
// TEST_CLASS_PROPERTY(L"ActivationContext", L"TerminalApp.LocalTests.manifest")
TEST_CLASS_PROPERTY(L"RunAs", L"UAP")
TEST_CLASS_PROPERTY(L"UAP:AppXManifest", L"TerminalApp.LocalTests.AppxManifest.xml")
END_TEST_CLASS()

TEST_METHOD(TryCreateWinRTType);
Expand Down Expand Up @@ -62,6 +64,8 @@ namespace TerminalAppLocalTests
TEST_METHOD(TestCloseOnExitParsing);
TEST_METHOD(TestCloseOnExitCompatibilityShim);

TEST_METHOD(TestTerminalArgsForBinding);

TEST_CLASS_SETUP(ClassSetup)
{
InitializeJsonReader();
Expand Down
23 changes: 14 additions & 9 deletions src/cascadia/LocalTests_TerminalApp/TabTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ namespace TerminalAppLocalTests
// deploy once per class when used like this.)
BEGIN_TEST_CLASS(TabTests)
TEST_CLASS_PROPERTY(L"RunAs", L"UAP")
TEST_CLASS_PROPERTY(L"UAP:AppXManifest", L"TerminalApp.LocalTests.AppxManifest.xml")
TEST_CLASS_PROPERTY(L"UAP:Host", L"XAML")
TEST_CLASS_PROPERTY(L"UAP:WaitForXamlWindowActivation", L"true")
// TEST_CLASS_PROPERTY(L"UAP:AppXManifest", L"TerminalApp.LocalTests.AppxManifest.xml")
TEST_CLASS_PROPERTY(L"UAP:AppXManifest", L"SUA")
END_TEST_CLASS()

// These four tests act as canary tests. If one of them fails, then they
Expand All @@ -45,24 +48,25 @@ namespace TerminalAppLocalTests

TEST_CLASS_SETUP(ClassSetup)
{
winrt::init_apartment(winrt::apartment_type::single_threaded);
// Initialize the Xaml Hosting Manager
_manager = winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread();
_source = winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource{};
// winrt::init_apartment(winrt::apartment_type::single_threaded);
// // Initialize the Xaml Hosting Manager
// _manager = winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread();
// _source = winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource{};

return true;
}

private:
winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager _manager{ nullptr };
winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource _source{ nullptr };
// winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager _manager{ nullptr };
// winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource _source{ nullptr };
};

void TabTests::TryInitXamlIslands()
{
// Ensures that XAML Islands was initialized correctly
VERIFY_IS_NOT_NULL(_manager);
VERIFY_IS_NOT_NULL(_source);
// VERIFY_IS_NOT_NULL(_manager);
// VERIFY_IS_NOT_NULL(_source);
VERIFY_IS_TRUE(true);
}

void TabTests::TryCreateLocalWinRTType()
Expand All @@ -81,6 +85,7 @@ namespace TerminalAppLocalTests
{
// Verify we can create a some XAML objects
// Just creating all of them is enough to know that everything is working.
DebugBreak();
winrt::Windows::UI::Xaml::Controls::UserControl controlRoot;
VERIFY_IS_NOT_NULL(controlRoot);
winrt::Windows::UI::Xaml::Controls::Grid root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0"
ResourceId="en-us" />

<Properties>
<DisplayName>TerminalApp.LocalTests.Package Host Process</DisplayName>
<PublisherDisplayName>Microsoft Corp.</PublisherDisplayName>
<Logo>taef.png</Logo>
<Description>TAEF Packaged Cwa FullTrust Application Host Process</Description>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.18362.0" MaxVersionTested="10.0.18362.0" />
<PackageDependency Name="Microsoft.VCLibs.140.00.Debug" MinVersion="14.0.27023.1" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<PackageDependency Name="Microsoft.VCLibs.140.00.Debug.UWPDesktop" MinVersion="14.0.27027.1" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>

<Resources>
<Resource Language="en-us" />
</Resources>
<Applications>

<!-- <Applications>
<Application Id="TE.ProcessHost" Executable="TE.ProcessHost.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="TAEF Packaged Cwa FullTrust Application Host Process" Square150x150Logo="taef.png" Square44x44Logo="taef.png" Description="TAEF Packaged Cwa Application Host Process" BackgroundColor="#222222">
<uap:SplashScreen Image="taef.png" />
Expand All @@ -45,7 +49,16 @@
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
</Capabilities> -->

<Applications>
<Application Id="TE.ProcessHost" Executable="TE.ProcessHost.UAP.exe" EntryPoint="ProcessHostApplication">
<uap:VisualElements DisplayName="TAEF UWA Host Process" Square150x150Logo="taef.png" Square44x44Logo="taef.png" Description="TAEF UWA Host Process" BackgroundColor="#222222">
<uap:SplashScreen Image="taef.png" />
</uap:VisualElements>
</Application>
</Applications>




Expand Down

0 comments on commit b392ba0

Please sign in to comment.