tcsAnswerTrackAdded.TrySetResult(false);
};
- _answerClient.AudioFrameEncoded += (s, e) => Log.Info(LogInfo.Tag, "Enter");
+ _answerClient.AudioFrameEncoded += (s, e) => Log.Info(WebRTCTestLog.Tag, "Enter");
var offerSource = new MediaTestSource(MediaType.Audio);
tcsAnswerTrackAdded.TrySetResult(false);
};
- _answerClient.AudioFrameEncoded += (s, e) => Log.Info(LogInfo.Tag, "Enter");
+ _answerClient.AudioFrameEncoded += (s, e) => Log.Info(WebRTCTestLog.Tag, "Enter");
var offerSource = new MediaTestSource(MediaType.Audio);
tcsAnswerTrackAdded.TrySetResult(false);
};
- _answerClient.AudioFrameEncoded += (s, e) => Log.Info(LogInfo.Tag, "Enter");
+ _answerClient.AudioFrameEncoded += (s, e) => Log.Info(WebRTCTestLog.Tag, "Enter");
var offerSource = new MediaTestSource(MediaType.Audio);
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using NUnit.Framework;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.Remoting.ErrorOccurred Tests")]
+ public class ErrorOccurredEventTests : TestBase
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ErrorOccurred event is invoked or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTC.ErrorOccurred E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task ErrorOccurred_CHECK_EVENT()
+ {
+ using (var webRtc = new WebRTC())
+ using (var eventAwaiter = EventAwaiter<WebRTCErrorOccurredEventArgs>.Create())
+ {
+ var tcs = new TaskCompletionSource<bool>();
+
+ var cameraSource = new MediaCameraSource();
+ webRtc.AddSource(cameraSource);
+
+ cameraSource.VideoFrameRate = 10000;
+
+ webRtc.ErrorOccurred += eventAwaiter;
+
+ webRtc.Start();
+
+ Assert.That(await eventAwaiter.IsRaisedAsync(), Is.EqualTo(true),
+ "Should return InvalidOperation");
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using NUnit.Framework;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.Remoting.WebRTCErrorOccurredEventArgs Test class")]
+ public class WebRTCErrorOccurredEventArgsTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Check whether WebRTCErrorOccurredEventArgs.Error returns valid value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCErrorOccurredEventArgs.Error A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Error_READ_ONLY()
+ {
+ using (var webRtc = new WebRTC())
+ using (var eventAwaiter = EventAwaiter<WebRTCErrorOccurredEventArgs>.Create())
+ {
+ var tcs = new TaskCompletionSource<bool>();
+
+ var cameraSource = new MediaCameraSource();
+ webRtc.AddSource(cameraSource);
+
+ cameraSource.VideoFrameRate = 10000;
+
+ webRtc.ErrorOccurred += eventAwaiter;
+
+ webRtc.Start();
+
+ var args = await eventAwaiter.GetResultAsync();
+
+ Assert.IsNotNull(args.Error, "Error should not be null.");
+ Assert.IsInstanceOf<WebRTCError>(args.Error, "Should be same type");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether WebRTCErrorOccurredEventArgs.State returns valid value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCErrorOccurredEventArgs.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task State_READ_ONLY()
+ {
+ using (var webRtc = new WebRTC())
+ using (var eventAwaiter = EventAwaiter<WebRTCErrorOccurredEventArgs>.Create())
+ {
+ var tcs = new TaskCompletionSource<bool>();
+
+ var cameraSource = new MediaCameraSource();
+ webRtc.AddSource(cameraSource);
+
+ cameraSource.VideoFrameRate = 10000;
+
+ webRtc.ErrorOccurred += eventAwaiter;
+
+ webRtc.Start();
+
+ var args = await eventAwaiter.GetResultAsync();
+
+ Assert.IsNotNull(args.State, "State should not be null.");
+ Assert.IsInstanceOf<WebRTCState>(args.State, "Should be same type");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ToString returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCErrorOccurredEventArgs.ToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task ToString_CHECK_VALUE()
+ {
+ using (var webRtc = new WebRTC())
+ using (var eventAwaiter = EventAwaiter<WebRTCErrorOccurredEventArgs>.Create())
+ {
+ var tcs = new TaskCompletionSource<bool>();
+
+ var cameraSource = new MediaCameraSource();
+ webRtc.AddSource(cameraSource);
+
+ cameraSource.VideoFrameRate = 10000;
+
+ webRtc.ErrorOccurred += eventAwaiter;
+
+ webRtc.Start();
+
+ var args = await eventAwaiter.GetResultAsync();
+
+ Assert.AreEqual($"Error={args.Error}, State={args.State}", args.ToString(),
+ "Should be the same string");
+ }
+ }
+ }
+}