[ScreenMirroring][TCSACR-440] Add ConnectAsync method to support port selection 08/263608/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 7 Sep 2021 03:38:26 +0000 (12:38 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 13 Sep 2021 03:46:16 +0000 (12:46 +0900)
Change-Id: Ibafb94036475954b1ba377416a3d22b56305af40

tct-suite-vs/Tizen.Multimedia.Manual.Tests/testcase/ScreenMirroring/TSScreenMirroring.cs
tct-suite-vs/Tizen.Multimedia.Manual.Tests/testcase/ScreenMirroring/TSScreenMirroringAudioInfo.cs
tct-suite-vs/Tizen.ScreenMirroring.Tests/testcase/TSScreenMirroring.cs

index 9dc973a..56e191a 100755 (executable)
@@ -18,6 +18,7 @@ namespace Tizen.Multimedia.Tests
         [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MCST")]
+        [Property("COVPARAM", "string")]
         [Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
         [Precondition(1, "For screen mirroring manual testing, we need one more devices(that is, we need 2 devices(source target and sink target(On sink target, we should execute tct))")]
         [Precondition(2, "Please install 'scm_testfile.tpk'(called 'app') on source target(TM1). 'scm_testfile.tpk' is located in this path. ->(/opt/tct/tizen_csharp_3.0/resource/helper-applications)")]
@@ -65,5 +66,60 @@ namespace Tizen.Multimedia.Tests
             ScreenMirroring.Disconnect();
             await Task.Delay(1000);
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test ConnectAsync with port method")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MCST")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        [Precondition(1, "For screen mirroring manual testing, we need one more devices(that is, we need 2 devices(source target and sink target(On sink target, we should execute tct))")]
+        [Precondition(2, "Please install 'scm_testfile.tpk'(called 'app') on source target(TM1). 'scm_testfile.tpk' is located in this path. ->(/opt/tct/tizen_csharp_3.0/resource/helper-applications)")]
+        [Precondition(3, "Please Connect both(source and sink) with 'Wi-Fi Direct' and launch 'app' on source target. ")]
+        [Precondition(4, "After launching 'app', please touch 'Source Start' button in the 'app'.")]
+        [Precondition(5, "Right after, 'app' shows you on display 'Received callback error code[0],state[3]' message. Then source is in ready. (source target process complete)")]
+        [Step(1, "Please touch 'Run' button on the bottom of screen.")]
+        [Step(2, "And manual TC shows you 'Start' button. Please touch it.")]
+        [Step(3, "If it works well, 'app' in source target shows you 'Received callback error code[0],state[4]' message and 'Received callback error code[0],state[7]' message in order.")]
+        [Step(4, "Screen on sink target automatically comback to previous and test case is succeeded, screen on sink target shows you 'PASS' message automatically.")]
+        [Step(5, "When failed, it shows you 'FAIL' message.")]
+        public async Task ConnectAsync_WITH_PORT_CHANGE_STATE()
+        {
+            Log.Debug(LogTag, "Start ConnectAsync_CHANGE_STATE");
+            if (await CheckScreenMirroringSupported() || await CheckWifiDirectSupported())
+            {
+                return;
+            }
+
+            ScreenMirroring.Prepare(_display);
+            ScreenMirroring.StateChanged += (s, e) =>
+            {
+                if (e.State == ScreenMirroringState.Connected)
+                {
+                    _msgBox.Text = "TC is passed. Please go back to previous page.";
+                    ManualTest.Confirm();
+                }
+            };
+
+            /*
+             * TEST CODE
+             * test preview
+             */
+            await CreateButton("Start Test");
+
+            _button1.Clicked += (sender, e) =>
+            {
+                ScreenMirroring.ConnectAsync(Ip, 7777);
+
+                _button1.IsEnabled = false;
+            };
+
+            await ManualTest.WaitForConfirm();
+
+            ScreenMirroring.Disconnect();
+            await Task.Delay(1000);
+        }
     }
 }
index f147d20..5ab2846 100755 (executable)
@@ -92,7 +92,7 @@ namespace Tizen.Multimedia.Tests
         [Step(3, "If it works well, 'app' in source target shows you 'Received callback error code[0],state[4]' message and 'Received callback error code[0],state[7]' message in order.")]
         [Step(4, "Screen on sink target automatically comback to previous and if test case is succeeded, screen on sink target shows you 'PASS' message automatically.")]
         [Step(5, "When failed, it shows you 'FAIL' message.")]
-        public async Task Channel_GET_NEGOTIATED_PROPERTY()
+        public async Task Channels_GET_NEGOTIATED_PROPERTY()
         {
             Log.Debug(LogTag, "Test Start Channel_GET_NEGOTIATED_PROPERTY");
             if (await CheckScreenMirroringSupported() || await CheckWifiDirectSupported())
index 7bb86b4..c175230 100755 (executable)
@@ -298,6 +298,7 @@ namespace Tizen.Multimedia.Tests
         [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string")]
         [Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
         public async Task ConnectAsync_CHECK_EXCEPTION()
         {
@@ -323,6 +324,7 @@ namespace Tizen.Multimedia.Tests
         [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string")]
         [Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
         public void ConnectAsync_CHECK_AUGUMENT_NULL_EXCEPTION()
         {
@@ -351,6 +353,7 @@ namespace Tizen.Multimedia.Tests
         [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string")]
         [Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
         public void ConnectAsync_CHECK_AUGUMENT_EXCEPTION()
         {
@@ -375,6 +378,78 @@ namespace Tizen.Multimedia.Tests
 
         [Test]
         [Category("P2")]
+        [Description("Invoke ConnectAsync method before Preapare method, and check InvalidOperation exception is thrown or not")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ConnectAsync_WITH_PORT_CHECK_EXCEPTION()
+        {
+            Assert.That(async () => await _screenmirroring.ConnectAsync(_ip, 2022), Throws.InvalidOperationException,
+                "Should throw InvalidOperationException");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Invoke ConnectAsync method before Preapare method, and check ArgumentNullexception is thrown or not")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ConnectAsync_WITH_PORT_CHECK_AUGUMENT_NULL_EXCEPTION()
+        {
+            Assert.Throws<ArgumentNullException>(() =>
+                _screenmirroring.ConnectAsync(sourceIp: null, port: 2022));
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Invoke ConnectAsync method before Preapare method, and check Argumentexception is thrown or not")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ConnectAsync_WITH_PORT_CHECK_AUGUMENT_EXCEPTION()
+        {
+            Assert.That(() => _screenmirroring.ConnectAsync("", 2022), Throws.ArgumentException,
+                "Should throw ArgumentException");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Invoke ConnectAsync method before Preapare method, and check ArgumentOutOfRangeexception is thrown or not")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ConnectAsync_WITH_PORT_CHECK_OUT_OF_RANGE()
+        {
+            Assert.That(() => _screenmirroring.ConnectAsync(_ip, 100000), Throws.TypeOf<ArgumentOutOfRangeException>(),
+                "Should throw ArgumentOutOfRangeException");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Invoke ConnectAsync method before Preapare method, and check whether throws ObjectDisposedException if ScreenMirroring is already disposed")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.ConnectAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("COVPARAM", "string, uint")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ConnectAsync_WITH_PORT_THROWS_IF_ALREADY_DISPOSED()
+        {
+            _screenmirroring.Dispose();
+
+            Assert.That(() => _screenmirroring.ConnectAsync(_ip, 2022), Throws.TypeOf<ObjectDisposedException>(),
+                "Should throw ObjectDisposedException");
+        }
+
+        [Test]
+        [Category("P2")]
         [Description("Invoke StartAsync method before Preapare method, and check InvalidOperation exception is thrown or not")]
         [Property("SPEC", "Tizen.Multimedia.Remoting.ScreenMirroring.StartAsync M")]
         [Property("SPEC_URL", "-")]