using Tizen;
using Tizen.Applications;
using ElmSharp;
+using Tizen.System;
namespace Tizen.Applications.Tests
{
private RemoteView _remoteView;
private double _period = 0;
+ private bool _isWidgetSupported = false;
+
[SetUp]
public void Init()
{
Log.Debug("[TCT]", "START");
- if (_window == null)
- _window = new Window(Application.Current.ApplicationInfo.ApplicationId);
-
- _window.Show();
- _background = new Background(_window)
+ Information.TryGetValue("http://tizen.org/feature/shell.appwidget", out _isWidgetSupported);
+ try\r
+ {\r
+ if (_window == null)\r
+ _window = new Window(Application.Current.ApplicationInfo.ApplicationId);\r
+\r
+ _window.Show();\r
+ _background = new Background(_window)\r
+ {\r
+ AlignmentX = -1,\r
+ AlignmentY = -1,\r
+ WeightX = 1,\r
+ WeightY = 1,\r
+ Color = Color.Black\r
+ };\r
+ _background.Show();\r
+ _window.AddResizeObject(_background);\r
+\r
+ RemoteViewFactory.Init(_window);\r
+ _remoteView = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, true, true);\r
+ Log.Debug("[TCT]", "END");\r
+ }
+ catch (NotSupportedException)
{
- AlignmentX = -1,
- AlignmentY = -1,
- WeightX = 1,
- WeightY = 1,
- Color = Color.Black
- };
- _background.Show();
- _window.AddResizeObject(_background);
-
- RemoteViewFactory.Init(_window);
- _remoteView = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, true, true);
- Log.Debug("[TCT]", "END");
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ Assert.Pass("widget feature disabled pass");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("There should be no exception " + e.ToString());
+ }
}
[TearDown]
using Tizen;
using Tizen.Applications;
using ElmSharp;
+using Tizen.System;
namespace Tizen.Applications.Tests
{
private double _period = 0;
private bool _flag;
+ private bool _isWidgetSupported = false;
+
[SetUp]
public void Init()
{
_background.Show();
_window.AddResizeObject(_background);
_flag = false;
+
+ Information.TryGetValue("http://tizen.org/feature/shell.appwidget", out _isWidgetSupported);
Log.Debug("[TCT]", "END");
}
RemoteViewFactory.Init(_window);
_flag = true;
}
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
catch (Exception e)
{
Assert.Fail(e.ToString());
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
{
- RemoteViewFactory.Init(_window);
- _flag = true;
- }
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }
- var myRemoteView = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, true, true);
- Assert.IsNotNull(myRemoteView, "Object should not be null");
- Assert.IsInstanceOf<RemoteView>(myRemoteView);
- Log.Debug("[TCT]", "END");
+ var myRemoteView = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, true, true);
+ Assert.IsNotNull(myRemoteView, "Object should not be null");
+ Assert.IsInstanceOf<RemoteView>(myRemoteView);
+ Log.Debug("[TCT]", "END");\r
+ }
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
+ }
}
[Test]
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
+ {\r
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }
+
+ var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, false, false, true);
+ Assert.IsNotNull(myRemoteView1, "Object should not be null");
+ Assert.IsInstanceOf<RemoteView>(myRemoteView1);
+ Log.Debug("[TCT]", "END");\r
+ }\r
+ catch (NotSupportedException)
{
- RemoteViewFactory.Init(_window);
- _flag = true;
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
}
-
- var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, false, false, true);
- Assert.IsNotNull(myRemoteView1, "Object should not be null");
- Assert.IsInstanceOf<RemoteView>(myRemoteView1);
- Log.Debug("[TCT]", "END");
}
[Test]
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
+ {\r
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }
+
+ var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, false, false);
+ Assert.IsNotNull(myRemoteView1, "Object should not be null");
+ Assert.IsInstanceOf<RemoteView>(myRemoteView1);
+ Log.Debug("[TCT]", "END");\r
+ }\r
+ catch (NotSupportedException)
{
- RemoteViewFactory.Init(_window);
- _flag = true;
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
}
-
- var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, false, false);
- Assert.IsNotNull(myRemoteView1, "Object should not be null");
- Assert.IsInstanceOf<RemoteView>(myRemoteView1);
- Log.Debug("[TCT]", "END");
}
[Test]
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
+ {\r
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }
+
+ var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, false, false);
+ Assert.IsNotNull(myRemoteView1, "Object should not be null");
+ Assert.IsInstanceOf<RemoteView>(myRemoteView1);
+ Log.Debug("[TCT]", "END");\r
+ }\r
+ catch (NotSupportedException)
{
- RemoteViewFactory.Init(_window);
- _flag = true;
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
}
-
- var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, true, false, false);
- Assert.IsNotNull(myRemoteView1, "Object should not be null");
- Assert.IsInstanceOf<RemoteView>(myRemoteView1);
- Log.Debug("[TCT]", "END");
}
[Test]
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
+ {\r
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }
+
+ var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, false, false, false);
+ Assert.IsNotNull(myRemoteView1, "Object should not be null");
+ Assert.IsInstanceOf<RemoteView>(myRemoteView1);
+ Log.Debug("[TCT]", "END");\r
+ }\r
+ catch (NotSupportedException)
{
- RemoteViewFactory.Init(_window);
- _flag = true;
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
}
-
- var myRemoteView1 = RemoteViewFactory.Create(_window, _widgetId, _content, _period, false, false, false);
- Assert.IsNotNull(myRemoteView1, "Object should not be null");
- Assert.IsInstanceOf<RemoteView>(myRemoteView1);
- Log.Debug("[TCT]", "END");
}
[Test]
*/
Log.Debug("[TCT]", "START");
- if (!_flag)
+ try\r
+ {\r
+ if (!_flag)
+ {
+ RemoteViewFactory.Init(_window);
+ _flag = true;
+ }\r
+ }\r
+ catch (NotSupportedException)
{
- RemoteViewFactory.Init(_window);
- _flag = true;
+ Assert.IsTrue(_isWidgetSupported == false, "Invalid NotSupportedException");
+ Assert.Pass("widget feature disabled pass");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail(e.ToString());
}
try