12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using UnityEngine;
- using System.IO;
- using System.Diagnostics;
- using System.Linq;
- using UnityEngine.TestTools;
- using NUnit.Framework;
- using UnityEditor;
- namespace Unity.WebRTC.EditorTest {
- class PluginTest {
-
-
-
-
- [Test]
- [UnityPlatform(RuntimePlatform.WindowsEditor)]
- public static void IsPluginLoaded() {
-
-
- Process currentProcess = Process.GetCurrentProcess();
- var names = currentProcess.Modules
- .Cast<ProcessModule>()
- .Where(_ => _ != null)
- .Select(_ => Path.GetFileNameWithoutExtension(_.ModuleName));
- Assert.That(names, Contains.Item(WebRTC.GetModuleName()));
- }
- [Test]
- public static void CheckPluginImportSettings() {
- string[] guids = AssetDatabase.FindAssets("", new[] {"Packages/com.unity.webrtc/Runtime/Plugins"});
- foreach (string guid in guids) {
- string path = AssetDatabase.GUIDToAssetPath(guid);
- AssetImporter assetImporter = AssetImporter.GetAtPath(path);
- Assert.IsNotNull(assetImporter);
- if (assetImporter.GetType() != typeof(PluginImporter))
- continue;
- PluginImporter pluginImporter = assetImporter as PluginImporter;
- Assert.That(pluginImporter, Is.Not.Null);
- Assert.That(pluginImporter.isPreloaded, Is.True);
- }
-
- }
- }
- }
|