/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
#include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <toolkit-adaptor-impl.h>
-#include <toolkit-singleton-service.h>
#include <toolkit-lifecycle-controller.h>
namespace Dali
using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
ToolkitTestApplication::ToolkitTestApplication( size_t surfaceWidth, size_t surfaceHeight, float horizontalDpi, float verticalDpi )
-: TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, ResourcePolicy::DALI_DISCARDS_ALL_DATA, false /* Do not Initialize Core */ ),
+: TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, false /* Do not Initialize Core */ ),
+ mMainWindow( new Dali::Window ),
mAdaptor( &AdaptorImpl::New() ) // Need to create Adaptor first as many singletons in dali-adaptor need it
{
// Create Core next
// Override Scene creation in TestApplication by creating a window.
// The window will create a Scene & surface and set up the scene's surface appropriately.
- Window window( Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" ) );
- mScene = AdaptorImpl::GetScene( window );
- mRenderSurface = dynamic_cast< TestRenderSurface* >( mScene.GetSurface() );
+ *mMainWindow = Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" );
+ mScene = AdaptorImpl::GetScene( *mMainWindow );
mScene.SetDpi( Vector2( horizontalDpi, verticalDpi ) );
// Core needs to be initialized next before we start the adaptor
InitializeCore();
-
- auto singletonService = SingletonService::Get();
- Test::SetApplication( singletonService, *this );
+ Accessibility::Accessible::SetObjectRegistry(mCore->GetObjectRegistry());
// This will also emit the window created signals
- AdaptorImpl::GetImpl( *mAdaptor ).Start( window );
+ AdaptorImpl::GetImpl( *mAdaptor ).Start( *mMainWindow );
+ AdaptorImpl::GetImpl( *mAdaptor ).SetApplication( *this );
Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
lifecycleController.InitSignal().Emit();
// Need to delete core before we delete the adaptor.
delete mCore;
mCore = NULL;
-
- // Set mRenderSurface to null, it will be deleted by the window that owns it
- mRenderSurface = nullptr;
}
void ToolkitTestApplication::RunIdles()