{
public class TestRunner : CoreUIApplication
{
- private Window _firstPageWindow;
+ internal Window _firstPageWindow;
private static bool s_terminated;
public static string ResourceDir { get; private set; }
+ public string Profile { get; set; }
+
public TestRunner()
{
s_terminated = false;
private Window CreateWindow(bool isSecond = false)
{
- Window window = new Window("ElmSharp UI Tests");
+ Window window = new Window("ElmSharp UI Tests")
+ {
+ AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
+ };
window.Show();
if (isSecond)
{
- window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true);
- window.KeyUp += (s, e) =>
+ window.BackButtonPressed += (s, e) =>
{
- if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
- {
- window.Hide();
- window.Unrealize();
- GC.Collect();
- GC.WaitForPendingFinalizers();
- }
+ window.Hide();
+ window.Unrealize();
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
};
}
else
{
- window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
- window.KeyUp += (s, e) =>
+ window.BackButtonPressed += (s, e) =>
{
- if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
- {
- UIExit();
- }
+ UIExit();
};
}
return window;
WeightY = 1,
};
box.Show();
- conformant.SetContent(box);
+ var bg = new Background(_firstPageWindow);
+ bg.Color = Color.White;
+ bg.SetContent(box);
+ conformant.SetContent(bg);
GenList list = new GenList(_firstPageWindow)
{
{
GetTextHandler = (data, part) =>
{
- return string.Format("{0}",(string)data);
+ TestCaseBase tc = data as TestCaseBase;
+ return tc == null ? "" : tc.TestName;
}
};
- foreach (var tc in testCases)
+ foreach (var tc in testCases.Where<TestCaseBase>((tc) => tc.TargetProfile.HasFlag(GetTargetProfile())))
{
- list.Append(defaultClass, tc.TestName);
+ list.Append(defaultClass, tc);
+ }
+
+ if (Profile == "wearable")
+ {
+ list.Prepend(defaultClass, null);
+ list.Append(defaultClass, null);
}
list.ItemSelected += (s, e) =>
{
- foreach (var tc in testCases)
- {
- if (tc.TestName == (string)(e.Item.Data))
- {
- StartTCFromList(tc);
- break;
- }
- }
+ TestCaseBase tc = e.Item.Data as TestCaseBase;
+ StartTCFromList(tc);
};
list.Show();
tc.Run(window);
}
+ private TargetProfile GetTargetProfile()
+ {
+ switch (Profile)
+ {
+ case "wearable" :
+ return TargetProfile.Wearable;
+ case "mobile" :
+ return TargetProfile.Mobile;
+ case "tv":
+ return TargetProfile.Tv;
+ }
+ return TargetProfile.Mobile;
+ }
+
static void Main(string[] args)
{
Elementary.Initialize();
Elementary.ThemeOverlay();
- Console.WriteLine("ELM_PROFILE : {0}", Elementary.GetProfile());
+ var profile = Elementary.GetProfile();
+ Console.WriteLine("ELM_PROFILE : {0}", profile);
Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale());
+ /*Elementary.EvasObjectRealized += (s, e) =>
+ {
+ var obj = (EvasObject)s;
+ Console.WriteLine("EvasObject Realized : {0}", obj.GetType());
+ };
+
+ Elementary.ItemObjectRealized += (s, e) =>
+ {
+ var obj = (ItemObject)s;
+ Console.WriteLine("ItemObject Realized : {0} (Parent : {1})", obj.GetType(), obj.Parent != null? obj.Parent.GetType() : null);
+ };*/
+
TestRunner testRunner = new TestRunner();
+ testRunner.Profile = profile;
testRunner.Run(args);
// if running with appfw is failed, below line will be executed.