51e63b017351b4d16a95e6d85e547d19b63d699d
[platform/core/uifw/dali-core.git] / automated-tests / dali-internal-test-suite / image-factory / utc-Dali-ImageFactory.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <tet_api.h>
21
22 #include <dali/public-api/dali-core.h>
23
24 #include <dali-test-suite-utils.h>
25
26 // Internal headers are allowed here
27 #include <dali/internal/event/common/thread-local-storage.h>
28 #include <dali/internal/event/images/image-factory.h>
29 #include <dali/internal/event/resources/resource-ticket.h>
30
31 using namespace Dali;
32
33 using Internal::ResourceTicketPtr;
34 using Internal::ImageFactory;
35 using Internal::ImageFactoryCache::RequestPtr;
36
37 static void Startup();
38 static void Cleanup();
39
40 extern "C" {
41   void (*tet_startup)() = Startup;
42   void (*tet_cleanup)() = Cleanup;
43 }
44
45 static const char* gTestImageFilename = "icon_wrt.png";
46
47 enum {
48   POSITIVE_TC_IDX = 0x01,
49   NEGATIVE_TC_IDX,
50 };
51
52 #define MAX_NUMBER_OF_TESTS 10000
53 extern "C" {
54   struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS];
55 }
56
57 // Add test functionality for all APIs in the class (Positive and Negative)
58
59 TEST_FUNCTION( UtcDaliImageFactoryUseCachedRequest01,   POSITIVE_TC_IDX );
60 TEST_FUNCTION( UtcDaliImageFactoryUseCachedRequest02,   POSITIVE_TC_IDX );
61 TEST_FUNCTION( UtcDaliImageFactoryUseCachedRequest03,   POSITIVE_TC_IDX );
62 TEST_FUNCTION( UtcDaliImageFactoryUseCachedRequest04,   POSITIVE_TC_IDX );
63 TEST_FUNCTION( UtcDaliImageFactoryCompatibleResource01, POSITIVE_TC_IDX );
64 TEST_FUNCTION( UtcDaliImageFactoryCompatibleResource02, POSITIVE_TC_IDX );
65 TEST_FUNCTION( UtcDaliImageFactoryCompatibleResource03, POSITIVE_TC_IDX );
66 TEST_FUNCTION( UtcDaliImageFactoryReload01,             POSITIVE_TC_IDX );
67 TEST_FUNCTION( UtcDaliImageFactoryReload02,             POSITIVE_TC_IDX );
68 TEST_FUNCTION( UtcDaliImageFactoryReload03,             POSITIVE_TC_IDX );
69 TEST_FUNCTION( UtcDaliImageFactoryReload04,             POSITIVE_TC_IDX );
70 TEST_FUNCTION( UtcDaliImageFactoryReload05,             POSITIVE_TC_IDX );
71 TEST_FUNCTION( UtcDaliImageFactoryReload06,             POSITIVE_TC_IDX );
72
73 // Called only once before first test is run.
74 static void Startup()
75 {
76 }
77
78 // Called only once after last test is run
79 static void Cleanup()
80 {
81 }
82
83 static void EmulateImageLoaded( TestApplication& application, unsigned int width, unsigned int height )
84 {
85   // emulate load success
86   Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
87   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  true  );
88   Integration::ResourcePointer resource( bitmap );
89   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height, width, height );
90   if( request )
91   {
92     application.GetPlatform().SetResourceLoaded( request->GetId(), request->GetType()->id, resource );
93   }
94
95   application.SendNotification();
96   application.Render();
97
98   application.SendNotification();
99   application.Render();
100 }
101
102 // High-level test for image factory request cache
103 static void UtcDaliImageFactoryUseCachedRequest01()
104 {
105   TestApplication application;
106
107   tet_infoline( "UtcDaliImageFactoryCachedRequest01 - Request same image more than once" );
108
109   Image image = Image::New( gTestImageFilename );
110
111   application.SendNotification();
112   application.Render();
113   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
114   application.GetPlatform().ResetTrace();
115
116   Image image2 = Image::New( gTestImageFilename );
117
118   application.SendNotification();
119   application.Render();
120
121   // check resource is not loaded twice
122   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
123   application.GetPlatform().ResetTrace();
124
125   Image image3 = Image::New( gTestImageFilename );
126
127   application.SendNotification();
128   application.Render();
129   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
130 }
131
132 // High-level test for image factory request cache
133 static void UtcDaliImageFactoryUseCachedRequest02()
134 {
135   TestApplication application;
136
137   // testing resource deletion when taken off stage
138   tet_infoline( "UtcDaliImageFactoryCachedRequest02 - Discard previously requested resource" );
139
140   Image image = Image::New( gTestImageFilename, Image::Immediate, Image::Unused );
141   ImageActor actor = ImageActor::New( image );
142
143   application.SendNotification();
144   application.Render();
145
146   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
147   application.GetPlatform().ResetTrace();
148
149   // Add actor to stage
150   Stage::GetCurrent().Add( actor );
151
152   application.Render();
153   application.SendNotification();
154   application.Render();
155   application.SendNotification();
156
157   // Release the resource, request is still cached
158   Stage::GetCurrent().Remove( actor );
159   application.Render();
160   application.SendNotification();
161   application.Render();
162   application.SendNotification();
163
164   // Should find stale request in cache, so load image from filesystem
165   Image image2 = Image::New( gTestImageFilename );
166
167   application.SendNotification();
168   application.Render();
169
170   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
171   application.GetPlatform().ResetTrace();
172
173   // Resource is reloaded
174   Image image3 = Image::New( gTestImageFilename );
175
176   application.SendNotification();
177   application.Render();
178   application.SendNotification();
179   application.Render();
180
181   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
182 }
183
184 // Low-level test for image factory request cache
185 static void UtcDaliImageFactoryUseCachedRequest03()
186 {
187   TestApplication application;
188   tet_infoline( "UtcDaliImageFactoryCachedRequest03 - Request same image more than once - Request Ids" );
189
190   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
191
192   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
193   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
194
195   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, NULL );
196   ResourceTicketPtr ticket2 = imageFactory.Load( req2.Get() );
197   DALI_TEST_EQUALS( req, req2, TEST_LOCATION );
198   DALI_TEST_EQUALS( ticket, ticket2, TEST_LOCATION );
199
200   req2 = imageFactory.RegisterRequest( gTestImageFilename, NULL );
201   ResourceTicketPtr ticket3 = imageFactory.Load( req2.Get() );
202   DALI_TEST_EQUALS( req, req2, TEST_LOCATION );
203   DALI_TEST_EQUALS( ticket, ticket3, TEST_LOCATION );
204
205   // request differs in scaled size - not default size
206   ImageAttributes attr = ImageAttributes::New( 80, 160, Pixel::BGR8888 );
207   req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr );
208   ResourceTicketPtr ticket4 = imageFactory.Load( req2.Get() );
209   DALI_TEST_CHECK( req != req2 );
210 }
211
212 // Low-level test for image factory request cache
213 static void UtcDaliImageFactoryUseCachedRequest04()
214 {
215   TestApplication application;
216   tet_infoline( "UtcDaliImageFactoryCachedRequest04 - Request same image with different Image objects - Request Ids" );
217
218   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
219
220   ImageAttributes attr = ImageAttributes::New( 80, 160, Pixel::BGR8888 );
221   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, &attr );
222
223   ImageAttributes attr2 = ImageAttributes::New( 80, 160, Pixel::BGR8888 );
224   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr2 );
225   DALI_TEST_EQUALS( req, req2, TEST_LOCATION );
226 }
227
228 // Different requests, compatible resource
229 static void UtcDaliImageFactoryCompatibleResource01()
230 {
231   TestApplication application;
232   tet_infoline( "UtcDaliImageFactoryCompatibleResource01 - Two requests mapping to same resource" );
233
234   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
235
236   Vector2 testSize(80.0f, 80.0f);
237   application.GetPlatform().SetImageMetaDataSize(testSize);
238
239   // request with default attributes ( size is 0,0 )
240   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
241   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
242
243   application.SendNotification();
244   application.Render();
245   application.SendNotification();
246   application.Render();
247
248   // emulate load success
249   EmulateImageLoaded( application, 80, 80 );
250
251   ImageAttributes attr = ImageAttributes::New();
252   attr.SetSize( 80, 80 );
253   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr );
254   ResourceTicketPtr ticket2 = imageFactory.Load( req2.Get() );
255
256   DALI_TEST_CHECK( req != req2 ); // different requests
257   DALI_TEST_EQUALS( ticket->GetId(), ticket2->GetId(), TEST_LOCATION ); // same resource
258 }
259
260 // Different requests, compatible resource
261 static void UtcDaliImageFactoryCompatibleResource02()
262 {
263   TestApplication application;
264   tet_infoline( "UtcDaliImageFactoryCompatibleResource02 - Two requests mapping to same resource." );
265
266   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
267
268   Vector2 testSize(80.0f, 80.0f);
269   application.GetPlatform().SetImageMetaDataSize(testSize);
270
271   // request with default attributes ( size is 0,0 )
272   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
273   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
274
275   application.SendNotification();
276   application.Render();
277   application.SendNotification();
278   application.Render();
279
280   // emulate load success
281   EmulateImageLoaded( application, 80, 80 );
282
283   // Request bigger size than actual image.
284   // This will load the same resource.
285   // However if image size changes later on to eg. 512*512 (file is overwritten),
286   // reissuing these two requests will load different resources.
287   // See UtcDaliImageFactoryReload06
288   ImageAttributes attr = ImageAttributes::New();
289   attr.SetSize( 92, 92 );
290   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr );
291   ResourceTicketPtr ticket2 = imageFactory.Load( req2.Get() );
292
293   DALI_TEST_CHECK( req != req2 ); // different requests
294   DALI_TEST_EQUALS( ticket->GetId(), ticket2->GetId(), TEST_LOCATION ); // same resource
295 }
296
297 // Different requests, compatible resource
298 static void UtcDaliImageFactoryCompatibleResource03()
299 {
300   TestApplication application;
301   tet_infoline( "UtcDaliImageFactoryCompatibleResource03 - Two requests mapping to same resource" );
302
303   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
304
305   Vector2 testSize(80.0f, 80.0f);
306   application.GetPlatform().SetImageMetaDataSize(testSize);
307
308   // this time use defined attributes, nut just NULL
309   ImageAttributes attr = ImageAttributes::New();
310   attr.SetSize( 120, 120 );
311
312   // request with default attributes ( size is 0,0 )
313   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, &attr );
314   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
315
316   application.SendNotification();
317   application.Render();
318   application.SendNotification();
319   application.Render();
320
321   // emulate load success
322   EmulateImageLoaded( application, 80, 80 );
323
324   ImageAttributes attr2 = ImageAttributes::New();
325   attr2.SetSize( 80, 80 );
326   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr2 );
327   ResourceTicketPtr ticket2 = imageFactory.Load( req2.Get() );
328
329   DALI_TEST_CHECK( req != req2 ); // different requests
330   DALI_TEST_EQUALS( ticket->GetId(), ticket2->GetId(), TEST_LOCATION ); // same resource
331 }
332
333 // Test for reloading image
334 static void UtcDaliImageFactoryReload01()
335 {
336   TestApplication application;
337   tet_infoline( "UtcDaliImageFactoryReload01 - Reload unchanged image" );
338
339   Vector2 testSize(80.0f, 80.0f);
340   application.GetPlatform().SetImageMetaDataSize(testSize);
341
342   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
343
344   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
345   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
346
347   ResourceTicketPtr ticket2 = imageFactory.Reload( req.Get() );
348   DALI_TEST_EQUALS( ticket, ticket2, TEST_LOCATION );
349
350   ResourceTicketPtr ticket3 = imageFactory.Reload( req.Get() );
351   DALI_TEST_EQUALS( ticket, ticket3, TEST_LOCATION );
352 }
353
354 // Testing file system access when reloading image
355 static void UtcDaliImageFactoryReload02()
356 {
357   TestApplication application;
358   tet_infoline( "UtcDaliImageFactoryReload02 - Reload unchanged image" );
359
360   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
361
362   Vector2 testSize(80.0f, 80.0f);
363   application.GetPlatform().SetImageMetaDataSize(testSize);
364
365   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
366   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
367
368   application.SendNotification();
369   application.Render();
370   application.SendNotification();
371   application.Render();
372
373   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
374   application.GetPlatform().ResetTrace();
375
376   ResourceTicketPtr ticket2 = imageFactory.Reload( req.Get() );
377
378   application.SendNotification();
379   application.Render();
380   application.SendNotification();
381   application.Render();
382
383   DALI_TEST_EQUALS( ticket, ticket2, TEST_LOCATION );
384   // resource is still loading, do not issue another request
385   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
386
387   // emulate load success
388   EmulateImageLoaded( application, 80, 80 );
389
390   ResourceTicketPtr ticket3 = imageFactory.Reload( req.Get() );
391
392   application.SendNotification();
393   application.Render();
394   application.SendNotification();
395   application.Render();
396
397   DALI_TEST_EQUALS( ticket, ticket3, TEST_LOCATION );
398   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
399   application.GetPlatform().ResetTrace();
400
401   ticket3 = imageFactory.Reload( req.Get() );
402
403   application.SendNotification();
404   application.Render();
405   application.SendNotification();
406   application.Render();
407
408   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
409 }
410
411 // Test for reloading changed image
412 static void UtcDaliImageFactoryReload03()
413 {
414   TestApplication application;
415   tet_infoline( "UtcDaliImageFactoryReload03 - Reload changed image" );
416
417   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
418
419   Vector2 testSize( 80.0f, 80.0f );
420   application.GetPlatform().SetImageMetaDataSize( testSize );
421
422   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
423   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
424
425   application.SendNotification();
426   application.Render();
427
428   // emulate load success
429   EmulateImageLoaded( application, 80, 80 );
430
431   Vector2 newSize( 192.0f, 192.0f );
432   application.GetPlatform().SetImageMetaDataSize( newSize );
433
434   // Image file changed size, new resource request should be issued
435   ResourceTicketPtr ticket2 = imageFactory.Reload( req.Get() );
436   DALI_TEST_CHECK( ticket != ticket2 );
437
438   ResourceTicketPtr ticket3 = imageFactory.Reload( req.Get() );
439   DALI_TEST_EQUALS( ticket2, ticket3, TEST_LOCATION );
440 }
441
442 // Testing file system access when reloading image
443 static void UtcDaliImageFactoryReload04()
444 {
445   TestApplication application;
446   tet_infoline( "UtcDaliImageFactoryReload04 - Reload unchanged image" );
447
448   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
449
450   Vector2 testSize(80.0f, 80.0f);
451   application.GetPlatform().SetImageMetaDataSize(testSize);
452
453   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
454   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
455
456   application.SendNotification();
457   application.Render();
458
459   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
460   application.GetPlatform().ResetTrace();
461
462   ResourceTicketPtr ticket2 = imageFactory.Reload( req.Get() );
463
464   application.SendNotification();
465   application.Render();
466   application.SendNotification();
467   application.Render();
468
469   DALI_TEST_EQUALS( ticket, ticket2, TEST_LOCATION );
470   // resource is still loading, do not issue another request
471   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
472
473   // emulate load success
474   EmulateImageLoaded( application, 80, 80 );
475
476   ResourceTicketPtr ticket3 = imageFactory.Reload( req.Get() );
477
478   application.SendNotification();
479   application.Render();
480   application.SendNotification();
481   application.Render();
482
483   // size didn't change, using same ticket
484   DALI_TEST_EQUALS( ticket, ticket3, TEST_LOCATION );
485   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
486   application.GetPlatform().ResetTrace();
487
488   // still loading
489   ticket3 = imageFactory.Reload( req.Get() );
490   application.SendNotification();
491   application.Render();
492   application.SendNotification();
493   application.Render();
494
495   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
496 }
497
498 // Testing OnDemand + Reload
499 // Reload should have no effect if OnDemand Image is not loaded yet, as stated in the API documentation
500 static void UtcDaliImageFactoryReload05()
501 {
502   TestApplication application;
503
504   tet_infoline( "UtcDaliImageFactoryReload05 - Reload OnDemand image" );
505
506   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
507
508   Vector2 testSize(80.0f, 80.0f);
509   application.GetPlatform().SetImageMetaDataSize(testSize);
510
511   RequestPtr req;
512   ImageAttributes attr = ImageAttributes::New();
513   attr.SetSize( 80, 80 );
514
515   // this happens first when loading Image OnDemand
516   req = imageFactory.RegisterRequest( gTestImageFilename, &attr );
517
518   application.SendNotification();
519   application.Render();
520
521   ResourceTicketPtr ticket = imageFactory.Reload( req.Get() );
522
523   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
524   DALI_TEST_CHECK( !ticket );
525
526   // this happens when Image is put on stage
527   ticket = imageFactory.Load( req.Get() );
528
529   application.SendNotification();
530   application.Render();
531
532   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
533   DALI_TEST_CHECK( ticket );
534   application.GetPlatform().ResetTrace();
535
536   ticket = imageFactory.Reload( req.Get() );
537
538   application.SendNotification();
539   application.Render();
540   application.SendNotification();
541   application.Render();
542
543   // still loading, no new request
544   DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
545
546   // emulate load success
547   EmulateImageLoaded( application, 80, 80 );
548
549   ticket = imageFactory.Reload( req.Get() );
550
551   application.SendNotification();
552   application.Render();
553
554   application.SendNotification();
555   application.Render();
556
557
558   DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
559 }
560
561 // Initally two different requests map to same resource.
562 // After overwriting the file, they load different image resources.
563 static void UtcDaliImageFactoryReload06()
564 {
565   TestApplication application;
566   tet_infoline( "UtcDaliImageFactoryReload06 - Two requests first mapping to same resource, then different resources." );
567
568   ImageFactory& imageFactory  = Internal::ThreadLocalStorage::Get().GetImageFactory();
569
570   Vector2 testSize(80.0f, 80.0f);
571   application.GetPlatform().SetImageMetaDataSize(testSize);
572
573   // request with default attributes ( size is 0,0 )
574   RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
575   ResourceTicketPtr ticket = imageFactory.Load( req.Get() );
576
577   application.SendNotification();
578   application.Render();
579   application.SendNotification();
580   application.Render();
581
582   // emulate load success
583   EmulateImageLoaded( application, 80, 80 );
584
585   // Request bigger size than actual image.
586   // This will load the same resource.
587   // However if image size changes later on to eg. 512*512 (file is overwritten),
588   // reissuing these two requests will load different resources.
589   ImageAttributes attr = ImageAttributes::New();
590   attr.SetSize( 92, 92 );
591   RequestPtr req2 = imageFactory.RegisterRequest( gTestImageFilename, &attr );
592   ResourceTicketPtr ticket2 = imageFactory.Load( req2.Get() );
593
594   DALI_TEST_CHECK( req != req2 ); // different requests
595   DALI_TEST_EQUALS( ticket->GetId(), ticket2->GetId(), TEST_LOCATION ); // same resource
596
597   Vector2 newSize(512.0f, 512.0f);
598   application.GetPlatform().SetImageMetaDataSize(newSize);
599
600   // reload fixed size (192,192) request
601   ticket2 = imageFactory.Reload( req2.Get() );
602
603   // emulate load success
604   // note: this is the only way to emulate what size is loaded by platform abstraction
605   EmulateImageLoaded( application, 92, 92 );
606
607   // reload default size request
608   ticket = imageFactory.Reload( req.Get() );
609
610   DALI_TEST_CHECK( ticket->GetId() != ticket2->GetId() ); // different resources
611 }