Loading WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs +37 −1 Original line number Diff line number Diff line Loading @@ -15,12 +15,48 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests /// </summary> public static class HoloLensHelpers { /// <summary> /// Validate the <see cref="SystemPerformanceInformation" /> returned from the HoloLens tests. /// </summary> /// <param name="systemPerfInfo">The <see cref="SystemPerformanceInformation" /> to validate.</param> internal static void ValidateSystemPerf(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. Assert.AreEqual(275897, systemPerfInfo.AvailablePages); Assert.AreEqual(764290, systemPerfInfo.CommitLimit); Assert.AreEqual(225486, systemPerfInfo.CommittedPages); Assert.AreEqual(20, systemPerfInfo.CpuLoad); Assert.AreEqual(4337544, systemPerfInfo.IoOtherSpeed); Assert.AreEqual(1717438, systemPerfInfo.IoReadSpeed); Assert.AreEqual(788621, systemPerfInfo.IoWriteSpeed); Assert.AreEqual(15470, systemPerfInfo.NonPagedPoolPages); Assert.AreEqual(4096, systemPerfInfo.PageSize); Assert.AreEqual(18894, systemPerfInfo.PagedPoolPages); Assert.AreEqual(2097152, systemPerfInfo.TotalInstalledKb); Assert.AreEqual(502146, systemPerfInfo.TotalPages); Assert.AreEqual(systemPerfInfo.GpuData.Adapters.Count, 1); GpuAdapter gpuAdapter = systemPerfInfo.GpuData.Adapters[0]; Assert.AreEqual((uint)119537664, gpuAdapter.DedicatedMemory); Assert.AreEqual((uint)65536, gpuAdapter.DedicatedMemoryUsed); Assert.AreEqual("HoloLens Graphics", gpuAdapter.Description); Assert.AreEqual((uint)1028395008, gpuAdapter.SystemMemory); Assert.AreEqual((uint)48513024, gpuAdapter.SystemMemoryUsed); Assert.AreEqual(9, gpuAdapter.EnginesUtilization.Count); Assert.AreEqual("7.098184", gpuAdapter.EnginesUtilization[0].ToString("n6")); NetworkPerformanceData networkPerformanceData = systemPerfInfo.NetworkData; Assert.AreEqual(0, networkPerformanceData.BytesIn); Assert.AreEqual(0, networkPerformanceData.BytesOut); } /// <summary> /// Helper method for verifying OS info based on a given version. /// </summary> /// <param name="friendlyOperatingSystemVersion">The friendly version of the OS we are targeting.</param> /// <param name="operatingSystemVersion">The version of the OS we are targeting.</param> public static void VerifyOsInformation( internal static void VerifyOsInformation( string friendlyOperatingSystemVersion, string operatingSystemVersion) { Loading WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs +40 −13 Original line number Diff line number Diff line Loading @@ -4,15 +4,11 @@ // </copyright> //---------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using static Microsoft.Tools.WindowsDevicePortal.DevicePortal; using System; namespace Microsoft.Tools.WindowsDevicePortal.Tests { Loading Loading @@ -102,6 +98,38 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests Assert.AreEqual("MyHoloLens", getTask.Result); } /// <summary> /// Gets the IP configuration using a mock generated on a HoloLens. /// </summary> [TestMethod] public void GetIpConfig_HoloLens_1607() { TestHelpers.MockHttpResponder.AddMockResponse( DevicePortal.IpConfigApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Task<IpConfiguration> getTask = TestHelpers.Portal.GetIpConfig(); getTask.Wait();; Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); IpConfiguration ipconfig = getTask.Result; // Check some known things about this response. Assert.AreEqual(2, ipconfig.Adapters.Count); NetworkAdapterInfo adapter = ipconfig.Adapters[0]; Assert.AreEqual("Bluetooth Device (Personal Area Network)", adapter.Description); Assert.AreEqual("4c-0b-be-ff-bd-64", adapter.MacAddress); Assert.AreEqual(7, adapter.Index); Assert.AreEqual(Guid.Parse("{765C05C8-7B46-4CE6-BEC9-33C6112234B4}"), adapter.Id); Assert.AreEqual("Ethernet", adapter.AdapterType); IpAddressInfo ipAddress = adapter.IpAddresses[0]; Assert.AreEqual("0.0.0.0", ipAddress.Address); Assert.AreEqual("0.0.0.0", ipAddress.SubnetMask); } /// <summary> /// Gets the user's interpupilary distance using a mock generated on a HoloLens. /// </summary> Loading Loading @@ -194,24 +222,23 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests } /// <summary> /// Gets the thermal stage using a mock generated on a HoloLens. /// Gets the system performance using a mock generated on a HoloLens. /// </summary> [TestMethod] public void GetThermalStage_HoloLens_1607() public void GetSystemPerf_HoloLens_1607() { TestHelpers.MockHttpResponder.AddMockResponse( DevicePortal.ThermalStageApi, DevicePortal.SystemPerfApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Task<ThermalStages> getTask = TestHelpers.Portal.GetThermalStage(); getTask.Wait(); Task<SystemPerformanceInformation> getSystemPerfTask = TestHelpers.Portal.GetSystemPerf(); getSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); Assert.AreEqual(TaskStatus.RanToCompletion, getSystemPerfTask.Status); // Check some known things about this response. Assert.AreEqual(ThermalStages.Normal, getTask.Result); HoloLensHelpers.ValidateSystemPerf(getSystemPerfTask.Result); } /// <summary> Loading WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// </summary> /// <returns>True if WiFi based communication requires a secure connection, false otherwise.</returns> /// <remarks>This method is only supported on HoloLens devices.</remarks> private async Task<bool> GetIsHttpsRequired() public async Task<bool> GetIsHttpsRequired() { if (this.Platform != DevicePortalPlatforms.HoloLens) { Loading Loading
WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs +37 −1 Original line number Diff line number Diff line Loading @@ -15,12 +15,48 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests /// </summary> public static class HoloLensHelpers { /// <summary> /// Validate the <see cref="SystemPerformanceInformation" /> returned from the HoloLens tests. /// </summary> /// <param name="systemPerfInfo">The <see cref="SystemPerformanceInformation" /> to validate.</param> internal static void ValidateSystemPerf(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. Assert.AreEqual(275897, systemPerfInfo.AvailablePages); Assert.AreEqual(764290, systemPerfInfo.CommitLimit); Assert.AreEqual(225486, systemPerfInfo.CommittedPages); Assert.AreEqual(20, systemPerfInfo.CpuLoad); Assert.AreEqual(4337544, systemPerfInfo.IoOtherSpeed); Assert.AreEqual(1717438, systemPerfInfo.IoReadSpeed); Assert.AreEqual(788621, systemPerfInfo.IoWriteSpeed); Assert.AreEqual(15470, systemPerfInfo.NonPagedPoolPages); Assert.AreEqual(4096, systemPerfInfo.PageSize); Assert.AreEqual(18894, systemPerfInfo.PagedPoolPages); Assert.AreEqual(2097152, systemPerfInfo.TotalInstalledKb); Assert.AreEqual(502146, systemPerfInfo.TotalPages); Assert.AreEqual(systemPerfInfo.GpuData.Adapters.Count, 1); GpuAdapter gpuAdapter = systemPerfInfo.GpuData.Adapters[0]; Assert.AreEqual((uint)119537664, gpuAdapter.DedicatedMemory); Assert.AreEqual((uint)65536, gpuAdapter.DedicatedMemoryUsed); Assert.AreEqual("HoloLens Graphics", gpuAdapter.Description); Assert.AreEqual((uint)1028395008, gpuAdapter.SystemMemory); Assert.AreEqual((uint)48513024, gpuAdapter.SystemMemoryUsed); Assert.AreEqual(9, gpuAdapter.EnginesUtilization.Count); Assert.AreEqual("7.098184", gpuAdapter.EnginesUtilization[0].ToString("n6")); NetworkPerformanceData networkPerformanceData = systemPerfInfo.NetworkData; Assert.AreEqual(0, networkPerformanceData.BytesIn); Assert.AreEqual(0, networkPerformanceData.BytesOut); } /// <summary> /// Helper method for verifying OS info based on a given version. /// </summary> /// <param name="friendlyOperatingSystemVersion">The friendly version of the OS we are targeting.</param> /// <param name="operatingSystemVersion">The version of the OS we are targeting.</param> public static void VerifyOsInformation( internal static void VerifyOsInformation( string friendlyOperatingSystemVersion, string operatingSystemVersion) { Loading
WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs +40 −13 Original line number Diff line number Diff line Loading @@ -4,15 +4,11 @@ // </copyright> //---------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using static Microsoft.Tools.WindowsDevicePortal.DevicePortal; using System; namespace Microsoft.Tools.WindowsDevicePortal.Tests { Loading Loading @@ -102,6 +98,38 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests Assert.AreEqual("MyHoloLens", getTask.Result); } /// <summary> /// Gets the IP configuration using a mock generated on a HoloLens. /// </summary> [TestMethod] public void GetIpConfig_HoloLens_1607() { TestHelpers.MockHttpResponder.AddMockResponse( DevicePortal.IpConfigApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Task<IpConfiguration> getTask = TestHelpers.Portal.GetIpConfig(); getTask.Wait();; Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); IpConfiguration ipconfig = getTask.Result; // Check some known things about this response. Assert.AreEqual(2, ipconfig.Adapters.Count); NetworkAdapterInfo adapter = ipconfig.Adapters[0]; Assert.AreEqual("Bluetooth Device (Personal Area Network)", adapter.Description); Assert.AreEqual("4c-0b-be-ff-bd-64", adapter.MacAddress); Assert.AreEqual(7, adapter.Index); Assert.AreEqual(Guid.Parse("{765C05C8-7B46-4CE6-BEC9-33C6112234B4}"), adapter.Id); Assert.AreEqual("Ethernet", adapter.AdapterType); IpAddressInfo ipAddress = adapter.IpAddresses[0]; Assert.AreEqual("0.0.0.0", ipAddress.Address); Assert.AreEqual("0.0.0.0", ipAddress.SubnetMask); } /// <summary> /// Gets the user's interpupilary distance using a mock generated on a HoloLens. /// </summary> Loading Loading @@ -194,24 +222,23 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests } /// <summary> /// Gets the thermal stage using a mock generated on a HoloLens. /// Gets the system performance using a mock generated on a HoloLens. /// </summary> [TestMethod] public void GetThermalStage_HoloLens_1607() public void GetSystemPerf_HoloLens_1607() { TestHelpers.MockHttpResponder.AddMockResponse( DevicePortal.ThermalStageApi, DevicePortal.SystemPerfApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Task<ThermalStages> getTask = TestHelpers.Portal.GetThermalStage(); getTask.Wait(); Task<SystemPerformanceInformation> getSystemPerfTask = TestHelpers.Portal.GetSystemPerf(); getSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); Assert.AreEqual(TaskStatus.RanToCompletion, getSystemPerfTask.Status); // Check some known things about this response. Assert.AreEqual(ThermalStages.Normal, getTask.Result); HoloLensHelpers.ValidateSystemPerf(getSystemPerfTask.Result); } /// <summary> Loading
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// </summary> /// <returns>True if WiFi based communication requires a secure connection, false otherwise.</returns> /// <remarks>This method is only supported on HoloLens devices.</remarks> private async Task<bool> GetIsHttpsRequired() public async Task<bool> GetIsHttpsRequired() { if (this.Platform != DevicePortalPlatforms.HoloLens) { Loading