Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ For documentation on the WDP REST endpoints which the project wraps, see the fol ### HoloLens specific methods [HoloLens Device Portal API reference](https://developer.microsoft.com/en-us/windows/holographic/device_portal_api_reference) [HoloLens Device Portal API reference](https://developer.microsoft.com/en-us/windows/mixed-reality/device_portal_api_reference) --- Loading Samples/XboxWdpDriver/Program.cs +5 −2 Original line number Diff line number Diff line Loading @@ -338,8 +338,11 @@ namespace XboxWdpDriver break; case OperationType.InstallOperation: if (!parameters.HasParameter(ParameterHelper.IpOrHostname)) { // Ensure we have an IP since SMB might need it for path generation. parameters.AddParameter(ParameterHelper.IpOrHostname, targetConsole); } InstallOperation.HandleOperation(portal, parameters); break; Loading WindowsDevicePortalWrapper/UnitTestProject/Core/EtwTests.cs +4 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,9 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests.Core ValidateEtwProviders(getEtwProvidersTask.Result); } /// <summary> /// Basic test of Get methof for getting ETW events. /// </summary> [TestMethod] public void GetEtwEventsTest() { Loading WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs +21 −23 Original line number Diff line number Diff line Loading @@ -4,11 +4,11 @@ // </copyright> //---------------------------------------------------------------------------------------------- using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using static Microsoft.Tools.WindowsDevicePortal.DevicePortal; namespace Microsoft.Tools.WindowsDevicePortal.Tests Loading Loading @@ -307,7 +307,6 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests // Check some known things about this response. Assert.AreEqual(0, installTime.RebootScheduled); } /// <summary> Loading Loading @@ -396,21 +395,20 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests Assert.AreEqual(TaskStatus.RanToCompletion, setIoTDeviceName.Status); } /// <summary> /// Simple test to set SoftAp Settings /// </summary> [TestMethod] public void SetSoftApSettingsTest_IoT() { string SoftApEnabled = "true"; string SoftApSsid = "SoftAPSsid"; string SoftApPassword = "p@ssw0rd"; string softApEnabled = "true"; string softApSsid = "SoftAPSsid"; string softApPassword = "p@ssw0rd"; HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SoftAPSettingsApi, response, HttpMethods.Post); Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettingsAsync(SoftApEnabled, SoftApSsid, SoftApPassword); Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettingsAsync(softApEnabled, softApSsid, softApPassword); setSoftApSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setSoftApSettings.Status); Loading Loading @@ -694,10 +692,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetRenderVolumeApi, response, HttpMethods.Post); Task RenderVolume = TestHelpers.Portal.SetRenderVolumeAsync(renderVolume); RenderVolume.Wait(); Task renderVolumeTask = TestHelpers.Portal.SetRenderVolumeAsync(renderVolume); renderVolumeTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, RenderVolume.Status); Assert.AreEqual(TaskStatus.RanToCompletion, renderVolumeTask.Status); } /// <summary> Loading @@ -711,10 +709,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetCaptureVolumeApi, response, HttpMethods.Post); Task CaptureVolume = TestHelpers.Portal.SetCaptureVolumeAsync(captureVolume); CaptureVolume.Wait(); Task captureVolumeTask = TestHelpers.Portal.SetCaptureVolumeAsync(captureVolume); captureVolumeTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, CaptureVolume.Status); Assert.AreEqual(TaskStatus.RanToCompletion, captureVolumeTask.Status); } /// <summary> Loading @@ -729,10 +727,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Post); Task IcsStart = TestHelpers.Portal.IcSharingStartAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStart.Wait(); Task icsStart = TestHelpers.Portal.IcSharingStartAsync(privateInterfaceIndex, publicInterfaceIndex); icsStart.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStart.Status); Assert.AreEqual(TaskStatus.RanToCompletion, icsStart.Status); } /// <summary> Loading @@ -747,10 +745,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Delete); Task IcsStop = TestHelpers.Portal.IcSharingStopAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStop.Wait(); Task icsStop = TestHelpers.Portal.IcSharingStopAsync(privateInterfaceIndex, publicInterfaceIndex); icsStop.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStop.Status); Assert.AreEqual(TaskStatus.RanToCompletion, icsStop.Status); } /// <summary> Loading Loading @@ -966,8 +964,8 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests public void SetTpmLogicalDeviceSettingsTest_IoT() { int logicalDeviceId = 1; string azureUri = ""; string azureKey = ""; string azureUri = string.Empty; string azureKey = string.Empty; HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(string.Format("{0}/{1}", DevicePortal.TpmSettingsApi, logicalDeviceId), response, HttpMethods.Post); Loading Loading @@ -1005,7 +1003,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests string validity = "18000"; TestHelpers.MockHttpResponder.AddMockResponse( string.Format("{0}/{1}", TpmAzureTokenApi, logicalDeviceId), string.Format("{0}/{1}", DevicePortal.TpmAzureTokenApi, logicalDeviceId), this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Loading WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs +8 −8 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { await Task.Run(() => { webSocketTask = TestHelpers.MockHttpResponder.WebSocketAsync(endpoint); this.webSocketTask = TestHelpers.MockHttpResponder.WebSocketAsync(endpoint); this.IsConnected = true; }); } Loading @@ -77,8 +77,8 @@ namespace Microsoft.Tools.WindowsDevicePortal { await Task.Run(() => { webSocketTask.Dispose(); webSocketTask = null; this.webSocketTask.Dispose(); this.webSocketTask = null; this.IsConnected = false; }); } Loading Loading @@ -115,9 +115,9 @@ namespace Microsoft.Tools.WindowsDevicePortal { while (this.keepListeningForMessages) { await webSocketTask.ConfigureAwait(false); await this.webSocketTask.ConfigureAwait(false); using (HttpResponseMessage response = webSocketTask.Result) using (HttpResponseMessage response = this.webSocketTask.Result) { if (!response.IsSuccessStatusCode) { Loading Loading @@ -155,10 +155,10 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>The task of sending the message to the websocket</returns> private async Task SendMessageInternalAsync(string message) { await webSocketTask.ConfigureAwait(false); webSocketTask.Wait(); await this.webSocketTask.ConfigureAwait(false); this.webSocketTask.Wait(); using (HttpResponseMessage response = webSocketTask.Result) using (HttpResponseMessage response = this.webSocketTask.Result) { if (!response.IsSuccessStatusCode) { Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ For documentation on the WDP REST endpoints which the project wraps, see the fol ### HoloLens specific methods [HoloLens Device Portal API reference](https://developer.microsoft.com/en-us/windows/holographic/device_portal_api_reference) [HoloLens Device Portal API reference](https://developer.microsoft.com/en-us/windows/mixed-reality/device_portal_api_reference) --- Loading
Samples/XboxWdpDriver/Program.cs +5 −2 Original line number Diff line number Diff line Loading @@ -338,8 +338,11 @@ namespace XboxWdpDriver break; case OperationType.InstallOperation: if (!parameters.HasParameter(ParameterHelper.IpOrHostname)) { // Ensure we have an IP since SMB might need it for path generation. parameters.AddParameter(ParameterHelper.IpOrHostname, targetConsole); } InstallOperation.HandleOperation(portal, parameters); break; Loading
WindowsDevicePortalWrapper/UnitTestProject/Core/EtwTests.cs +4 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,9 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests.Core ValidateEtwProviders(getEtwProvidersTask.Result); } /// <summary> /// Basic test of Get methof for getting ETW events. /// </summary> [TestMethod] public void GetEtwEventsTest() { Loading
WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs +21 −23 Original line number Diff line number Diff line Loading @@ -4,11 +4,11 @@ // </copyright> //---------------------------------------------------------------------------------------------- using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using static Microsoft.Tools.WindowsDevicePortal.DevicePortal; namespace Microsoft.Tools.WindowsDevicePortal.Tests Loading Loading @@ -307,7 +307,6 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests // Check some known things about this response. Assert.AreEqual(0, installTime.RebootScheduled); } /// <summary> Loading Loading @@ -396,21 +395,20 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests Assert.AreEqual(TaskStatus.RanToCompletion, setIoTDeviceName.Status); } /// <summary> /// Simple test to set SoftAp Settings /// </summary> [TestMethod] public void SetSoftApSettingsTest_IoT() { string SoftApEnabled = "true"; string SoftApSsid = "SoftAPSsid"; string SoftApPassword = "p@ssw0rd"; string softApEnabled = "true"; string softApSsid = "SoftAPSsid"; string softApPassword = "p@ssw0rd"; HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SoftAPSettingsApi, response, HttpMethods.Post); Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettingsAsync(SoftApEnabled, SoftApSsid, SoftApPassword); Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettingsAsync(softApEnabled, softApSsid, softApPassword); setSoftApSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setSoftApSettings.Status); Loading Loading @@ -694,10 +692,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetRenderVolumeApi, response, HttpMethods.Post); Task RenderVolume = TestHelpers.Portal.SetRenderVolumeAsync(renderVolume); RenderVolume.Wait(); Task renderVolumeTask = TestHelpers.Portal.SetRenderVolumeAsync(renderVolume); renderVolumeTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, RenderVolume.Status); Assert.AreEqual(TaskStatus.RanToCompletion, renderVolumeTask.Status); } /// <summary> Loading @@ -711,10 +709,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetCaptureVolumeApi, response, HttpMethods.Post); Task CaptureVolume = TestHelpers.Portal.SetCaptureVolumeAsync(captureVolume); CaptureVolume.Wait(); Task captureVolumeTask = TestHelpers.Portal.SetCaptureVolumeAsync(captureVolume); captureVolumeTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, CaptureVolume.Status); Assert.AreEqual(TaskStatus.RanToCompletion, captureVolumeTask.Status); } /// <summary> Loading @@ -729,10 +727,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Post); Task IcsStart = TestHelpers.Portal.IcSharingStartAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStart.Wait(); Task icsStart = TestHelpers.Portal.IcSharingStartAsync(privateInterfaceIndex, publicInterfaceIndex); icsStart.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStart.Status); Assert.AreEqual(TaskStatus.RanToCompletion, icsStart.Status); } /// <summary> Loading @@ -747,10 +745,10 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Delete); Task IcsStop = TestHelpers.Portal.IcSharingStopAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStop.Wait(); Task icsStop = TestHelpers.Portal.IcSharingStopAsync(privateInterfaceIndex, publicInterfaceIndex); icsStop.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStop.Status); Assert.AreEqual(TaskStatus.RanToCompletion, icsStop.Status); } /// <summary> Loading Loading @@ -966,8 +964,8 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests public void SetTpmLogicalDeviceSettingsTest_IoT() { int logicalDeviceId = 1; string azureUri = ""; string azureKey = ""; string azureUri = string.Empty; string azureKey = string.Empty; HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(string.Format("{0}/{1}", DevicePortal.TpmSettingsApi, logicalDeviceId), response, HttpMethods.Post); Loading Loading @@ -1005,7 +1003,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests string validity = "18000"; TestHelpers.MockHttpResponder.AddMockResponse( string.Format("{0}/{1}", TpmAzureTokenApi, logicalDeviceId), string.Format("{0}/{1}", DevicePortal.TpmAzureTokenApi, logicalDeviceId), this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); Loading
WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs +8 −8 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { await Task.Run(() => { webSocketTask = TestHelpers.MockHttpResponder.WebSocketAsync(endpoint); this.webSocketTask = TestHelpers.MockHttpResponder.WebSocketAsync(endpoint); this.IsConnected = true; }); } Loading @@ -77,8 +77,8 @@ namespace Microsoft.Tools.WindowsDevicePortal { await Task.Run(() => { webSocketTask.Dispose(); webSocketTask = null; this.webSocketTask.Dispose(); this.webSocketTask = null; this.IsConnected = false; }); } Loading Loading @@ -115,9 +115,9 @@ namespace Microsoft.Tools.WindowsDevicePortal { while (this.keepListeningForMessages) { await webSocketTask.ConfigureAwait(false); await this.webSocketTask.ConfigureAwait(false); using (HttpResponseMessage response = webSocketTask.Result) using (HttpResponseMessage response = this.webSocketTask.Result) { if (!response.IsSuccessStatusCode) { Loading Loading @@ -155,10 +155,10 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>The task of sending the message to the websocket</returns> private async Task SendMessageInternalAsync(string message) { await webSocketTask.ConfigureAwait(false); webSocketTask.Wait(); await this.webSocketTask.ConfigureAwait(false); this.webSocketTask.Wait(); using (HttpResponseMessage response = webSocketTask.Result) using (HttpResponseMessage response = this.webSocketTask.Result) { if (!response.IsSuccessStatusCode) { Loading