Commit e69aa95b authored by Hirsch Singhal's avatar Hirsch Singhal Committed by GitHub
Browse files

v0.9.4.1 Beta Release - re-add CSRF handling, formatting fixes (#241)

* Update content for WER
* Update docs for XML.

* Update Copyright to 2017 :)
parent 904195d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)

---

+5 −2
Original line number Diff line number Diff line
@@ -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;
+4 −1
Original line number Diff line number Diff line
@@ -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()
        {
+21 −23
Original line number Diff line number Diff line
@@ -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
@@ -307,7 +307,6 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests

            // Check some known things about this response.
            Assert.AreEqual(0, installTime.RebootScheduled);
             
        }

        /// <summary>
@@ -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);
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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);
@@ -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);
+8 −8
Original line number Diff line number Diff line
@@ -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;
            });
        }
@@ -77,8 +77,8 @@ namespace Microsoft.Tools.WindowsDevicePortal
        {
            await Task.Run(() =>
            {
                webSocketTask.Dispose();
                webSocketTask = null;
                this.webSocketTask.Dispose();
                this.webSocketTask = null;
                this.IsConnected = false;
            });
        }
@@ -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)
                        {
@@ -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