From 16dba67866ee1e25588f0c67b7effe4e50748b80 Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Mon, 23 Sep 2019 16:49:52 +0900 Subject: [PATCH] [WiFi][Non-ACR][Don't need to connect an AP to test specific scan] Change-Id: I035581cd81346a6cf7e96831b3a4d372848fc500 Signed-off-by: Cheoleun Moon --- .../Tizen.WiFi.Tests/testcase/TSWiFiManager.cs | 41 ++++++++-------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs b/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs index 6b29c8b..140841e 100755 --- a/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs +++ b/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs @@ -732,37 +732,26 @@ namespace Tizen.Network.WiFi.Tests { try { - /* - * PRECONDITION - */ - await setUp(); + var count = 0; - /* - * TEST CODE - */ - var found = false; - const int MAX_SCAN_TRY = 3; - for (int i = 0; i < MAX_SCAN_TRY; i++) + if (!WiFiManager.IsActive) { - await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1); - var listAp = WiFiManager.GetFoundSpecificAPs(); - foreach (WiFiAP item in listAp) - { - if (item.NetworkInformation.Essid == networkParameter.wnPRIVATE1) - { - found = true; - } - item.Dispose(); - } - if (found) - { - break; - } - await Task.Delay(1000); + await WiFiManager.ActivateAsync(); + } + await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE); + var listApp = WiFiManager.GetFoundSpecificAPs(); + await Task.Delay(1500); + foreach (var item in listApp) + { + count++; + item.Dispose(); } - Assert.IsTrue(found, "ScanSpecificApAsync can't scan WiFi private"); + Assert.Greater(count, 0, "ScanSpecificAPAsync fail"); Log.Info(Globals.LogTag, "Successfully done"); + + // POSTCONDITION + await setUp(); } catch (NotSupportedException) { -- 2.7.4