From e309a28608422c40220b7fea2f4ec682cd6bf21f Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 12 Mar 2024 16:44:58 +0900 Subject: [PATCH] [Tizen] (AutomatedTests) Let we make adaptor invalidate if adaptor stop Change-Id: I1436b6dcb86810821abdf90eff9c9a9d63e8ee0a Signed-off-by: Eunki, Hong --- .../dali-toolkit-test-utils/toolkit-adaptor-impl.h | 66 ++++++++++++---------- .../dali-toolkit-test-utils/toolkit-adaptor.cpp | 15 ++++- 2 files changed, 51 insertions(+), 30 deletions(-) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h index a705241..49c344a 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_ADAPTOR_IMPL_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,10 +37,8 @@ using WindowContainer = std::vector; namespace Internal { - namespace Adaptor { - class GraphicsInterface; class SceneHolder; @@ -50,7 +48,6 @@ class SceneHolder; namespace Integration { - class GlAbstraction; } // namespace Integration @@ -59,7 +56,6 @@ namespace Internal { namespace Adaptor { - class Adaptor { public: @@ -68,45 +64,57 @@ public: Adaptor(); ~Adaptor(); - void Start( Dali::Window window ); + void Start(Dali::Window window); + void Stop(); - bool AddIdle( CallbackBase* callback, bool hasReturnValue ); - void RemoveIdle( CallbackBase* callback ); + bool AddIdle(CallbackBase* callback, bool hasReturnValue); + void RemoveIdle(CallbackBase* callback); void RunIdles(); - static Integration::Scene GetScene( Dali::Window window ); + static Integration::Scene GetScene(Dali::Window window); Dali::RenderSurfaceInterface& GetSurface(); - Dali::WindowContainer GetWindows(); - Dali::SceneHolderList GetSceneHolders(); + Dali::WindowContainer GetWindows(); + Dali::SceneHolderList GetSceneHolders(); + + Dali::Internal::Adaptor::SceneHolder* GetWindow(Dali::Actor& actor); + void AddWindow(Internal::Adaptor::SceneHolder* window); + void RemoveWindow(Internal::Adaptor::SceneHolder* window); - Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor ); - void AddWindow( Internal::Adaptor::SceneHolder* window ); - void RemoveWindow( Internal::Adaptor::SceneHolder* window ); + void RegisterProcessor(Integration::Processor& processor, bool postProcessor = false); + void UnregisterProcessor(Integration::Processor& processor, bool postProcessor = false); - void RegisterProcessor( Integration::Processor& processor, bool postProcessor = false); - void UnregisterProcessor( Integration::Processor& processor, bool postProcessor = false); + void SetApplication(Dali::TestApplication& testApplication); - void SetApplication( Dali::TestApplication& testApplication ); + bool IsStopped() const + { + return mStopped; + } - Dali::Adaptor::AdaptorSignalType& ResizedSignal(); - Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal(); + Dali::Adaptor::AdaptorSignalType& ResizedSignal(); + Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal(); Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal(); Dali::Adaptor::LocaleChangedSignalType& LocaleChangedSignal(); - static Adaptor& GetImpl( Dali::Adaptor& adaptor ) { return *adaptor.mImpl; } - static const Adaptor& GetImpl( const Dali::Adaptor& adaptor ) { return *adaptor.mImpl; } + static Adaptor& GetImpl(Dali::Adaptor& adaptor) + { + return *adaptor.mImpl; + } + static const Adaptor& GetImpl(const Dali::Adaptor& adaptor) + { + return *adaptor.mImpl; + } private: - - Vector mCallbacks; - Vector mReturnCallbacks; + Vector mCallbacks; + Vector mReturnCallbacks; std::vector mWindows; - Dali::Adaptor::AdaptorSignalType mResizedSignal; - Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal; - Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal; - Dali::Adaptor::LocaleChangedSignalType mLocaleChangedSignal; - TestApplication* mTestApplication; + Dali::Adaptor::AdaptorSignalType mResizedSignal; + Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal; + Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal; + Dali::Adaptor::LocaleChangedSignalType mLocaleChangedSignal; + TestApplication* mTestApplication; + bool mStopped{false}; }; } // namespace Adaptor diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp index 566ca08..4d77310 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp @@ -79,6 +79,18 @@ void Adaptor::Start(Dali::Window window) AddWindow(&GetImplementation(window)); } +void Adaptor::Stop() +{ + if(mTestApplication) + { + Integration::Core& core = mTestApplication->GetCore(); + tet_printf("Adaptor::UnregisterProcessors\n"); + core.UnregisterProcessors(); + } + + mStopped = true; +} + Integration::Scene Adaptor::GetScene(Dali::Window window) { return window.GetScene(); @@ -266,6 +278,7 @@ void Adaptor::Resume() void Adaptor::Stop() { + mImpl->Stop(); } bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue) @@ -342,7 +355,7 @@ Adaptor& Adaptor::Get() bool Adaptor::IsAvailable() { - return Internal::Adaptor::gAdaptor; + return Internal::Adaptor::gAdaptor && (!Internal::Adaptor::Adaptor::GetImpl(*Internal::Adaptor::gAdaptor).IsStopped()); } void Adaptor::NotifySceneCreated() -- 2.7.4