2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali-test-suite-utils.h>
19 #include <dali/public-api/actors/drawable-actor.h>
23 bool Render(const RenderCallbackInput& inputData)
25 // Store the size of rendered area
26 size = inputData.size;
34 int UtcDaliDrawableActor1P(void)
36 tet_infoline("Testing DrawableActor");
37 TestApplication application;
39 DrawableObject drawable{};
41 auto callback = RenderCallback::New<DrawableObject>(&drawable, &DrawableObject::Render);
43 DrawableActor drawableActor = DrawableActor::New(*callback);
44 application.GetScene().Add(drawableActor);
46 drawableActor.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
48 // flush the queue and render once
49 application.SendNotification();
52 // Check the size (whether callback has been called)
53 auto size(drawable.size);
54 DALI_TEST_EQUALS(drawable.size, Size(100, 100), TEST_LOCATION);