-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT Run] VirtualDesktopHelper & WindowWalker improvements (#16325)
* Import vdh from poc * last changes * push changes * small change * add error handling to vdh * last changes * make spellchecker happy * last changes * last changes * spell check * fix settings defaults * Improve WindowWalkerSettings class * add comment * New settings and improvements * new features * subtitle and tool tip * spell fixes * small fixes * fixes * Explorer info * spell fixes * fixes and CloseWindow feature * last changes * first part of implementing KillProcess * killProcess Part 2 & Fixes * text fix and installer * update access modifiers * some fixes * update dev docs * fix dev docs * dev doc change * dev docs: add missed infos * dev docs: add link * Update src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowWalkerSettings.cs * fix build * resolve feedback * fix settings * add tests
- Loading branch information
Showing
33 changed files
with
1,765 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
46 changes: 46 additions & 0 deletions
46
...ns/Microsoft.Plugin.WindowWalker.UnitTests/Microsoft.Plugin.WindowWalker.UnitTests.csproj
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<Platforms>x64</Platforms> | ||
<RootNamespace>Microsoft.Plugin.WindowWalker.UnitTests</RootNamespace> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<AnalysisMode>Recommended</AnalysisMode> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Moq" Version="4.16.1" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" /> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.Plugin.WindowWalker\Microsoft.Plugin.WindowWalker.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\..\..\codeAnalysis\GlobalSuppressions.cs"> | ||
<Link>GlobalSuppressions.cs</Link> | ||
</Compile> | ||
<AdditionalFiles Include="..\..\..\..\codeAnalysis\StyleCop.json"> | ||
<Link>StyleCop.json</Link> | ||
</AdditionalFiles> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="StyleCop.Analyzers"> | ||
<Version>1.1.118</Version> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
71 changes: 71 additions & 0 deletions
71
src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker.UnitTests/PluginSettingsTests.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using Microsoft.Plugin.WindowWalker.Components; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Microsoft.Plugin.WindowWalker.UnitTests | ||
{ | ||
[TestClass] | ||
public class PluginSettingsTests | ||
{ | ||
[TestMethod] | ||
public void SettingsCount() | ||
{ | ||
// Setup | ||
PropertyInfo[] settings = WindowWalkerSettings.Instance?.GetType()?.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance); | ||
|
||
// Act | ||
var result = settings?.Length; | ||
|
||
// Assert | ||
Assert.AreEqual(8, result); | ||
} | ||
|
||
[DataTestMethod] | ||
[DataRow("ResultsFromVisibleDesktopOnly")] | ||
[DataRow("SubtitleShowPid")] | ||
[DataRow("SubtitleShowDesktopName")] | ||
[DataRow("ConfirmKillProcess")] | ||
[DataRow("KillProcessTree")] | ||
[DataRow("OpenAfterKillAndClose")] | ||
[DataRow("HideKillProcessOnElevatedProcesses")] | ||
[DataRow("HideExplorerSettingInfo")] | ||
public void DoesSettingExist(string name) | ||
{ | ||
// Setup | ||
Type settings = WindowWalkerSettings.Instance?.GetType(); | ||
|
||
// Act | ||
var result = settings?.GetProperty(name, BindingFlags.NonPublic | BindingFlags.Instance); | ||
|
||
// Assert | ||
Assert.IsNotNull(result); | ||
} | ||
|
||
[DataTestMethod] | ||
[DataRow("ResultsFromVisibleDesktopOnly", false)] | ||
[DataRow("SubtitleShowPid", false)] | ||
[DataRow("SubtitleShowDesktopName", true)] | ||
[DataRow("ConfirmKillProcess", true)] | ||
[DataRow("KillProcessTree", false)] | ||
[DataRow("OpenAfterKillAndClose", false)] | ||
[DataRow("HideKillProcessOnElevatedProcesses", false)] | ||
[DataRow("HideExplorerSettingInfo", false)] | ||
public void DefaultValues(string name, bool valueExpected) | ||
{ | ||
// Setup | ||
WindowWalkerSettings setting = WindowWalkerSettings.Instance; | ||
|
||
// Act | ||
PropertyInfo propertyInfo = setting?.GetType()?.GetProperty(name, BindingFlags.NonPublic | BindingFlags.Instance); | ||
var result = propertyInfo?.GetValue(setting); | ||
|
||
// Assert | ||
Assert.AreEqual(valueExpected, result); | ||
} | ||
} | ||
} |
Oops, something went wrong.