public static string fileName;
public static Tizen.Content.Download.NetworkType type;
public static IDictionary<string, string> httpHeaders;
- public static bool bFlag;
+ public static bool bCompletedFlag;
+ public static bool bDownloadingFlag;
public static bool isDownloadSupported = false;
public static bool isWifiSupported = false;
public static bool isWifiDirectSupported = false;
{
await Task.Delay(1000);
count++;
- if (bFlag)
+ if (bCompletedFlag)
{
- Tizen.Log.Info("Tizen.Content.Download" , "RequestTests bFlag is true");break;
+ Tizen.Log.Info("Tizen.Content.Download" , "RequestTests bCompletedFlag is true");break;
}
if (count == 30)
{
- Tizen.Log.Info("Tizen.Content.Download" , "RequestTests count is 8"); break;
+ Tizen.Log.Info("Tizen.Content.Download" , "RequestTests count is 30"); break;
}
}
}
type = NetworkType.All;
httpHeaders = new Dictionary<string, string>();
httpHeaders.Add("Pragma", "no-cache");
- bFlag = false;
+ bCompletedFlag = false;
+ bDownloadingFlag = false;
Information.TryGetValue("http://tizen.org/feature/download", out isDownloadSupported);
Information.TryGetValue("http://tizen.org/feature/network.wifi", out isWifiSupported);
static void OnProgressChanged(object sender, ProgressChangedEventArgs e)
{
Tizen.Log.Info("Tizen.Content.Download" , "OnProgressChanged");
- bFlag = true;
+ bCompletedFlag = true;
}
static void OnStateChanged(object sender, StateChangedEventArgs e)
{
- Tizen.Log.Info("Tizen.Content.Download" , "OnStateChanged"+e.State);
+ Tizen.Log.Info("Tizen.Content.Download" , "OnStateChanged"+e.State);
switch (e.State)
{
case DownloadState.None:
break;
case DownloadState.Downloading:
{
-
+ bDownloadingFlag = true;
}
break;
case DownloadState.Paused:
break;
case DownloadState.Completed:
{
- bFlag = true;
+ bCompletedFlag = true;
}
break;
case DownloadState.Canceled:
testRequest.Dispose();
- Assert.True(bFlag, "StateChanged event should occur");
+ Assert.True(bCompletedFlag, "StateChanged event should occur");
Tizen.Log.Info("Tizen.Content.Download" , "TC Completed");
}
catch (NotSupportedException)
testRequest.Dispose();
- Assert.True(bFlag, "ProgressChanged event should occur");
+ Assert.True(bCompletedFlag, "ProgressChanged event should occur");
Tizen.Log.Info("Tizen.Content.Download" , "TC Completed");
}
catch (NotSupportedException)
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((string)req.DownloadedPath, "DownloadedPath is null");
Assert.IsInstanceOf<string>( req.DownloadedPath , "DownloadedPath is not of the type string");
req.Dispose();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((string)req.MimeType, "MimeType is null");
Assert.IsInstanceOf<string>( req.MimeType , "MimeType is not of the type string");
req.Dispose();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((DownloadState)req.State, "State is null");
Assert.IsInstanceOf<DownloadState>( req.State , "State is not of the type DownloadState");
Assert.AreEqual((int)DownloadState.Completed, (int)req.State, "Request propety \"State\": value should be completed");
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((string)req.ContentName, "ContentName is null");
Assert.IsInstanceOf<string>( req.ContentName , "ContentName is not of the type string");
req.Dispose();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((ulong)req.ContentSize, "ContentSize is null");
Assert.IsInstanceOf<ulong>( req.ContentSize , "ContentSize is not of the type ulong");
req.Dispose();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bDownloadingFlag, "DownloadState should be Downloading or Completed");
Assert.IsNotNull((int)req.HttpStatus, "HttpStatus is null");
Assert.IsInstanceOf<int>( req.HttpStatus , "ContentSize is not of the type int");
req.Dispose();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Completed");
+ Assert.True(bCompletedFlag, "DownloadState should be Completed");
Assert.IsNotNull((string)req.ETagValue, "ETagValue is null");
Assert.IsInstanceOf<string>( req.ETagValue , "ETagValue is not of the type string");
req.Dispose();
break;
case DownloadState.Canceled:
{
- bFlag = true;
+ bCompletedFlag = true;
}
break;
}
break;
case DownloadState.Downloading:
{
- bFlag = true;
+ bCompletedFlag = true;
}
break;
case DownloadState.Paused:
break;
case DownloadState.Paused:
{
- bFlag = true;
+ bCompletedFlag = true;
}
break;
case DownloadState.Completed:
break;
case DownloadState.Canceled:
{
- bFlag = true;
+ bCompletedFlag = true;
}
break;
}
req.Start();
await waitFlag();
- Assert.True(bFlag, "DownloadState should be Downloading");
+ Assert.True(bCompletedFlag, "DownloadState should be Downloading");
Tizen.Log.Info("Tizen.Content.Download", "TC Completed");
}
catch (NotSupportedException)