Dali 3D User Interface Engine
utc-image-loading-common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 #ifndef __DALI_TEST_SUITE_IMAGE_LOADING_COMMON_H__
19 #define __DALI_TEST_SUITE_IMAGE_LOADING_COMMON_H__
20 #include <unistd.h>
21 #include <iostream>
22 #include <stdlib.h>
23 #include <ctime>
24 #include <dali/dali.h>
25 #include <dali-test-suite-utils.h>
27 #include "resource-collector.h"
28 
29 using namespace Dali;
30 using namespace Dali::Integration;
31 using namespace Dali::Internal::Platform;
32 
33 namespace
34 {
40 const unsigned NUM_LOAD_GROUPS_TO_ISSUE = 158;
41 
46 const unsigned NUM_CANCELLED_LOAD_GROUPS_TO_ISSUE = NUM_LOAD_GROUPS_TO_ISSUE * 10;
47 
49 const unsigned MAX_NUM_RESOURCE_TRIES = 10;
50 
52 const unsigned MAX_MILLIS_TO_WAIT_FOR_KNOWN_LOADS = 1000 * 60;
53 
55 const char* const VALID_IMAGES[] = {
56  TEST_IMAGE_DIR "/frac.jpg",
57  TEST_IMAGE_DIR "/frac.24.bmp",
58  TEST_IMAGE_DIR "/frac.png",
59  TEST_IMAGE_DIR "/interlaced.gif",
60  TEST_IMAGE_DIR "/pattern.gif",
61  TEST_IMAGE_DIR "/fractal-compressed-ETC1_RGB8_OES-45x80.ktx",
62  TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.astc",
63  TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico",
64  TEST_IMAGE_DIR "/test-image.wbmp"
65 };
66 const unsigned NUM_VALID_IMAGES = sizeof(VALID_IMAGES) / sizeof(VALID_IMAGES[0]);
67 
70 {
71  timespec timeSpec;
72  clock_gettime( CLOCK_MONOTONIC, &timeSpec );
73  return ( timeSpec.tv_sec * 1e3 ) + ( timeSpec.tv_nsec / 1e6 );
74 }
75 
76 } // anon namespace
77 
80 
82 typedef std::pair<ImageDimensions, std::pair<FittingMode::Type, std::pair<SamplingMode::Type, bool> > > ImageParameters;
83 extern std::vector<ImageParameters> gCancelAttributes;
84 
85 
86 void utc_dali_loading_startup(void);
87 void utc_dali_loading_cleanup(void);
88 
89 #endif // __DALI_TEST_SUITE_IMAGE_LOADING_COMMON_H__
Dali Docs Home
Read more about Dali