2 * Copyright (c) 2017 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.
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/internal/visuals/texture-manager-impl.h>
24 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
26 using namespace Dali::Toolkit::Internal;
28 class TestObserver : public Dali::Toolkit::TextureUploadObserver
33 mObserverCalled(false)
37 void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect )
39 mLoaded = loadSuccess;
40 mObserverCalled = true;
48 int UtcTextureManagerRequestLoad(void)
50 ToolkitTestApplication application;
52 TextureManager textureManager; // Create new texture manager
54 TestObserver observer;
55 std::string filename("image.png");
57 TextureManager::TextureId textureId = textureManager.RequestLoad(
60 FittingMode::SCALE_TO_FILL,
61 SamplingMode::BOX_THEN_LINEAR,
62 TextureManager::NO_ATLAS,
65 const VisualUrl& url = textureManager.GetVisualUrl( textureId );
67 DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );