From c1a751974cb44d8ea01f3ce1dd2aaa4c510d3d44 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Wed, 11 Jan 2017 15:26:01 +0900 Subject: [PATCH] Fix black screen error of ElmSharp.Test When ElmSharp.Test runs with AppFW, first screen was black because Elementary.ThemeOverlay() was not called. Change-Id: I725a3ad97f1b1bf10ee43472e7817491de49346f --- ElmSharp.Test/TestRunner.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ElmSharp.Test/TestRunner.cs b/ElmSharp.Test/TestRunner.cs index b359d20..b59f07f 100644 --- a/ElmSharp.Test/TestRunner.cs +++ b/ElmSharp.Test/TestRunner.cs @@ -27,11 +27,13 @@ namespace ElmSharp.Test public class TestRunner : CoreUIApplication { private Window _firstPageWindow; + private static bool s_terminated; public static string ResourceDir { get; private set; } public TestRunner() { + s_terminated = false; } protected override void OnCreate() @@ -43,13 +45,16 @@ namespace ElmSharp.Test base.OnCreate(); } + protected override void OnTerminate() + { + s_terminated = true; + base.OnTerminate(); + } + public void RunStandalone(string[] args) { ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res"); - Elementary.Initialize(); - Elementary.ThemeOverlay(); - EcoreSynchronizationContext.Initialize(); var testCases = GetTestCases(); @@ -193,11 +198,17 @@ namespace ElmSharp.Test static void Main(string[] args) { + Elementary.Initialize(); + Elementary.ThemeOverlay(); + TestRunner testRunner = new TestRunner(); testRunner.Run(args); // if running with appfw is failed, below line will be executed. - testRunner.RunStandalone(args); + if (!s_terminated) + { + testRunner.RunStandalone(args); + } } } } -- 2.7.4