Refactoring ImageVisualShaderFactory::GetShader
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-TextureManager.cpp
1 /*
2  * Copyright (c) 2020 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 #include <iostream>
19
20 #include <stdlib.h>
21
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <toolkit-timer.h>
24 #include <toolkit-event-thread-callback.h>
25 #include <dali-toolkit/internal/visuals/texture-manager-impl.h>
26 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
27 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
28 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
29 #include <dali-toolkit/internal/visuals/visual-factory-impl.h> ///< For VisualFactory's member TextureManager.
30
31 #include <test-encoded-image-buffer.h>
32
33 #if defined(ELDBUS_ENABLED)
34 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
35 #endif
36
37 using namespace Dali::Toolkit::Internal;
38
39 void utc_dali_toolkit_texture_manager_startup(void)
40 {
41   setenv( "LOG_TEXTURE_MANAGER", "3", 1 );
42   test_return_value = TET_UNDEF;
43 #if defined(ELDBUS_ENABLED)
44   DBusWrapper::Install(std::unique_ptr<DBusWrapper>(new TestDBusWrapper));
45 #endif
46 }
47
48 void utc_dali_toolkit_texture_manager_cleanup(void)
49 {
50   test_return_value = TET_PASS;
51 }
52
53 namespace
54 {
55
56 const char* TEST_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/gallery-small-1.jpg";
57
58 }
59
60 class TestObserver : public Dali::Toolkit::TextureUploadObserver
61 {
62 public:
63   enum class CompleteType
64   {
65     NOT_COMPLETED = 0,
66     UPLOAD_COMPLETE,
67     LOAD_COMPLETE
68   };
69
70 public:
71   TestObserver()
72   : mCompleteType( CompleteType::NOT_COMPLETED ),
73     mLoaded(false),
74     mObserverCalled(false)
75   {
76   }
77
78   virtual void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet,
79                                bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override
80   {
81     mCompleteType = CompleteType::UPLOAD_COMPLETE;
82     mLoaded = loadSuccess;
83     mObserverCalled = true;
84   }
85
86   virtual void LoadComplete( bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied ) override
87   {
88     mCompleteType = CompleteType::LOAD_COMPLETE;
89     mLoaded = loadSuccess;
90     mObserverCalled = true;
91   }
92
93   CompleteType mCompleteType;
94   bool mLoaded;
95   bool mObserverCalled;
96 };
97
98
99 int UtcTextureManagerRequestLoad(void)
100 {
101   ToolkitTestApplication application;
102
103   TextureManager textureManager; // Create new texture manager
104
105   TestObserver observer;
106   std::string filename("image.png");
107   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
108   TextureManager::TextureId textureId = textureManager.RequestLoad(
109     filename,
110     ImageDimensions(),
111     FittingMode::SCALE_TO_FILL,
112     SamplingMode::BOX_THEN_LINEAR,
113     TextureManager::NO_ATLAS,
114     &observer,
115     true,
116     TextureManager::ReloadPolicy::CACHED,
117     preMultiply);
118
119   VisualUrl url = textureManager.GetVisualUrl( textureId );
120
121   DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
122
123   END_TEST;
124 }
125
126 int UtcTextureManagerGenerateHash(void)
127 {
128   ToolkitTestApplication application;
129
130   TextureManager textureManager; // Create new texture manager
131
132   TestObserver observer;
133   std::string filename( "image.png" );
134   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
135   TextureManager::TextureId textureId = textureManager.RequestLoad(
136     filename,
137     ImageDimensions(),
138     FittingMode::SCALE_TO_FILL,
139     SamplingMode::BOX_THEN_LINEAR,
140     TextureManager::USE_ATLAS,
141     &observer,
142     true,
143     TextureManager::ReloadPolicy::CACHED,
144     preMultiply);
145
146   VisualUrl url = textureManager.GetVisualUrl( textureId );
147
148   DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
149
150   END_TEST;
151 }
152
153 int UtcTextureManagerEncodedImageBuffer(void)
154 {
155   ToolkitTestApplication application;
156   tet_infoline( "UtcTextureManagerEncodedImageBuffer" );
157
158   auto  visualFactory  = Toolkit::VisualFactory::Get();
159   auto& textureManager = GetImplementation(visualFactory).GetTextureManager(); // Use VisualFactory's texture manager
160
161   // Get encoded raw-buffer image and generate url
162   EncodedImageBuffer buffer1 = ConvertFileToEncodedImageBuffer(TEST_IMAGE_FILE_NAME);
163   EncodedImageBuffer buffer2 = ConvertFileToEncodedImageBuffer(TEST_IMAGE_FILE_NAME);
164
165   std::string  url1 = textureManager.AddExternalEncodedImageBuffer(buffer1);
166   std::string  url2 = textureManager.AddExternalEncodedImageBuffer(buffer1);
167   std::string  url3 = VisualUrl::CreateBufferUrl(""); ///< Impossible Buffer URL. for coverage
168
169   // Check if same EncodedImageBuffer get same url
170   DALI_TEST_CHECK(url1 == url2);
171   // Reduce reference count
172   textureManager.RemoveExternalEncodedImageBuffer(url1);
173   // Check whethere url1 still valid
174   DALI_TEST_CHECK(textureManager.GetEncodedImageBuffer(url1));
175
176   url2 = textureManager.AddExternalEncodedImageBuffer(buffer2);
177   // Check if difference EncodedImageBuffer get difference url
178   DALI_TEST_CHECK(url1 != url2);
179
180   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
181
182   TestObserver observer1;
183   textureManager.RequestLoad(
184     url1,
185     ImageDimensions(),
186     FittingMode::SCALE_TO_FILL,
187     SamplingMode::BOX_THEN_LINEAR,
188     TextureManager::NO_ATLAS,
189     &observer1,
190     true, ///< orientationCorrection
191     TextureManager::ReloadPolicy::CACHED,
192     preMultiply);
193
194   DALI_TEST_EQUALS( observer1.mLoaded, false, TEST_LOCATION );
195   DALI_TEST_EQUALS( observer1.mObserverCalled, false, TEST_LOCATION );
196
197   application.SendNotification();
198   application.Render();
199
200   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
201
202   application.SendNotification();
203   application.Render();
204
205   DALI_TEST_EQUALS( observer1.mLoaded, true, TEST_LOCATION );
206   DALI_TEST_EQUALS( observer1.mObserverCalled, true, TEST_LOCATION );
207   DALI_TEST_EQUALS( observer1.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
208
209   TestObserver observer2;
210   // Syncload
211   Devel::PixelBuffer pixelBuffer = textureManager.LoadPixelBuffer(
212     url2,
213     ImageDimensions(),
214     FittingMode::SCALE_TO_FILL,
215     SamplingMode::BOX_THEN_LINEAR,
216     true, ///< synchronousLoading
217     &observer2,
218     true, ///< orientationCorrection
219     preMultiply);
220
221   DALI_TEST_CHECK( pixelBuffer );
222   DALI_TEST_EQUALS( observer2.mLoaded, false, TEST_LOCATION );
223   DALI_TEST_EQUALS( observer2.mObserverCalled, false, TEST_LOCATION );
224
225   // Asyncload
226   pixelBuffer = textureManager.LoadPixelBuffer(
227     url2,
228     ImageDimensions(),
229     FittingMode::SCALE_TO_FILL,
230     SamplingMode::BOX_THEN_LINEAR,
231     false, ///< synchronousLoading
232     &observer2,
233     true, ///< orientationCorrection
234     preMultiply);
235
236   DALI_TEST_EQUALS( observer2.mLoaded, false, TEST_LOCATION );
237   DALI_TEST_EQUALS( observer2.mObserverCalled, false, TEST_LOCATION );
238
239   application.SendNotification();
240   application.Render();
241
242   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
243
244   application.SendNotification();
245   application.Render();
246
247   DALI_TEST_EQUALS( observer2.mLoaded, true, TEST_LOCATION );
248   DALI_TEST_EQUALS( observer2.mObserverCalled, true, TEST_LOCATION );
249   DALI_TEST_EQUALS( observer2.mCompleteType, TestObserver::CompleteType::LOAD_COMPLETE, TEST_LOCATION );
250
251   textureManager.RemoveExternalEncodedImageBuffer(url1);
252   textureManager.RemoveExternalEncodedImageBuffer(url2);
253
254   // Now url1 and url2 is invalid type. mLoaded will return false
255
256   TestObserver observer3;
257   textureManager.RequestLoad(
258     url1,
259     ImageDimensions(),
260     FittingMode::SCALE_TO_FILL,
261     SamplingMode::BOX_THEN_LINEAR,
262     TextureManager::NO_ATLAS,
263     &observer3,
264     true, ///< orientationCorrection
265     TextureManager::ReloadPolicy::CACHED,
266     preMultiply);
267
268   // Load will be success because url1 is cached
269   DALI_TEST_EQUALS( observer3.mLoaded, true, TEST_LOCATION );
270   DALI_TEST_EQUALS( observer3.mObserverCalled, true, TEST_LOCATION );
271   DALI_TEST_EQUALS( observer3.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
272
273   TestObserver observer4;
274   textureManager.RequestLoad(
275     url2,
276     ImageDimensions(),
277     FittingMode::SCALE_TO_FILL,
278     SamplingMode::BOX_THEN_LINEAR,
279     TextureManager::NO_ATLAS,
280     &observer4,
281     true, ///< orientationCorrection
282     TextureManager::ReloadPolicy::FORCED,
283     preMultiply);
284
285   DALI_TEST_EQUALS( observer4.mLoaded, false, TEST_LOCATION );
286   DALI_TEST_EQUALS( observer4.mObserverCalled, false, TEST_LOCATION );
287   application.SendNotification();
288   application.Render();
289
290   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
291
292   application.SendNotification();
293   application.Render();
294
295   // Load will be failed becuase reloadpolicy is forced
296   DALI_TEST_EQUALS( observer4.mLoaded, false, TEST_LOCATION );
297   DALI_TEST_EQUALS( observer4.mObserverCalled, true, TEST_LOCATION );
298   DALI_TEST_EQUALS( observer4.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
299
300   TestObserver observer5;
301   pixelBuffer = textureManager.LoadPixelBuffer(
302     url2,
303     ImageDimensions(),
304     FittingMode::SCALE_TO_FILL,
305     SamplingMode::BOX_THEN_LINEAR,
306     true, ///< synchronousLoading
307     &observer5,
308     true, ///< orientationCorrection
309     preMultiply);
310
311   // Load will be faild because synchronousLoading doesn't use cached texture
312   DALI_TEST_CHECK( !pixelBuffer );
313   DALI_TEST_EQUALS( observer5.mLoaded, false, TEST_LOCATION );
314   DALI_TEST_EQUALS( observer5.mObserverCalled, false, TEST_LOCATION );
315
316   TestObserver observer6;
317   pixelBuffer = textureManager.LoadPixelBuffer(
318     url3,
319     ImageDimensions(),
320     FittingMode::SCALE_TO_FILL,
321     SamplingMode::BOX_THEN_LINEAR,
322     false, ///< synchronousLoading
323     &observer6,
324     true, ///< orientationCorrection
325     preMultiply);
326
327   DALI_TEST_EQUALS( observer6.mLoaded, false, TEST_LOCATION );
328   DALI_TEST_EQUALS( observer6.mObserverCalled, false, TEST_LOCATION );
329
330   application.SendNotification();
331   application.Render();
332
333   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
334
335   application.SendNotification();
336   application.Render();
337
338   // Load will be failed because url3 is invalid URL
339   DALI_TEST_EQUALS( observer6.mLoaded, false, TEST_LOCATION );
340   DALI_TEST_EQUALS( observer6.mObserverCalled, true, TEST_LOCATION );
341   DALI_TEST_EQUALS( observer6.mCompleteType, TestObserver::CompleteType::LOAD_COMPLETE, TEST_LOCATION );
342
343   END_TEST;
344 }
345
346 int UtcTextureManagerEncodedImageBufferReferenceCount(void)
347 {
348   ToolkitTestApplication application;
349   tet_infoline( "UtcTextureManagerEncodedImageBuffer check reference count works well" );
350
351   auto  visualFactory  = Toolkit::VisualFactory::Get();
352   auto& textureManager = GetImplementation(visualFactory).GetTextureManager(); // Use VisualFactory's texture manager
353
354   // Get encoded raw-buffer image and generate url
355   EncodedImageBuffer buffer1 = ConvertFileToEncodedImageBuffer(TEST_IMAGE_FILE_NAME);
356   EncodedImageBuffer buffer2 = ConvertFileToEncodedImageBuffer(TEST_IMAGE_FILE_NAME);
357
358   std::string  url1    = textureManager.AddExternalEncodedImageBuffer(buffer1);
359   std::string  url2    = textureManager.AddExternalEncodedImageBuffer(buffer1);
360
361   // Check if same EncodedImageBuffer get same url
362   DALI_TEST_CHECK(url1 == url2);
363
364   // Reduce reference count
365   textureManager.RemoveExternalEncodedImageBuffer(url1);
366   // Check whethere url1 still valid
367   DALI_TEST_CHECK(textureManager.GetEncodedImageBuffer(url1));
368
369   // Reduce reference count
370   textureManager.RemoveExternalEncodedImageBuffer(url1);
371   // Check whethere url1 is not valid anymore
372   DALI_TEST_CHECK(!textureManager.GetEncodedImageBuffer(url1));
373
374   // UseExternalTexture doesn't create new buffer.
375   // So, reference count is still zero.
376   textureManager.UseExternalResource(url1);
377   DALI_TEST_CHECK(!textureManager.GetEncodedImageBuffer(url1));
378
379   url1 = textureManager.AddExternalEncodedImageBuffer(buffer1);
380   // Check if difference EncodedImageBuffer get difference url
381   // Previous EncodedImageBuffer was deleted, so we get new url even same buffer.
382   DALI_TEST_CHECK(url1 != url2);
383
384   url2 = textureManager.AddExternalEncodedImageBuffer(buffer2);
385   // Check if difference EncodedImageBuffer get difference url
386   DALI_TEST_CHECK(url1 != url2);
387
388   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
389
390   // url1 load image by cache
391   TestObserver observer1;
392   textureManager.RequestLoad(
393     url1,
394     ImageDimensions(),
395     FittingMode::SCALE_TO_FILL,
396     SamplingMode::BOX_THEN_LINEAR,
397     TextureManager::NO_ATLAS,
398     &observer1,
399     true, ///< orientationCorrection
400     TextureManager::ReloadPolicy::CACHED,
401     preMultiply);
402
403   DALI_TEST_EQUALS( observer1.mLoaded, false, TEST_LOCATION );
404   DALI_TEST_EQUALS( observer1.mObserverCalled, false, TEST_LOCATION );
405
406   application.SendNotification();
407   application.Render();
408
409   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
410
411   application.SendNotification();
412   application.Render();
413
414   DALI_TEST_EQUALS( observer1.mLoaded, true, TEST_LOCATION );
415   DALI_TEST_EQUALS( observer1.mObserverCalled, true, TEST_LOCATION );
416   DALI_TEST_EQUALS( observer1.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
417
418   // LoadPixelBuffer doen't use cache. url2 will not be cached
419   TestObserver observer2;
420   Devel::PixelBuffer pixelBuffer = textureManager.LoadPixelBuffer(
421     url2,
422     ImageDimensions(),
423     FittingMode::SCALE_TO_FILL,
424     SamplingMode::BOX_THEN_LINEAR,
425     false, ///< synchronousLoading
426     &observer2,
427     true, ///< orientationCorrection
428     preMultiply);
429
430   DALI_TEST_EQUALS( observer2.mLoaded, false, TEST_LOCATION );
431   DALI_TEST_EQUALS( observer2.mObserverCalled, false, TEST_LOCATION );
432
433   application.SendNotification();
434   application.Render();
435
436   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
437
438   application.SendNotification();
439   application.Render();
440
441   DALI_TEST_EQUALS( observer2.mLoaded, true, TEST_LOCATION );
442   DALI_TEST_EQUALS( observer2.mObserverCalled, true, TEST_LOCATION );
443   DALI_TEST_EQUALS( observer2.mCompleteType, TestObserver::CompleteType::LOAD_COMPLETE, TEST_LOCATION );
444
445   // Decrease each url's reference count.
446   textureManager.RemoveExternalEncodedImageBuffer(url1);
447   textureManager.RemoveExternalEncodedImageBuffer(url2);
448
449   // url1 buffer is still have 1 reference count because it is cached.
450   // But url2 not valid because it is not cached.
451   DALI_TEST_CHECK(textureManager.GetEncodedImageBuffer(url1));
452   DALI_TEST_CHECK(!textureManager.GetEncodedImageBuffer(url2));
453
454   // Check url1 buffer have 1 reference count because it is cached.
455   textureManager.RemoveExternalEncodedImageBuffer(url1);
456   DALI_TEST_CHECK(!textureManager.GetEncodedImageBuffer(url1));
457
458   END_TEST;
459 }
460
461
462 int UtcTextureManagerCachingForDifferentLoadingType(void)
463 {
464   ToolkitTestApplication application;
465   tet_infoline( "UtcTextureManagerCachingForDifferentLoadingType" );
466
467   TextureManager textureManager; // Create new texture manager
468
469   TestObserver observer1;
470   std::string filename( TEST_IMAGE_FILE_NAME );
471   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
472   textureManager.RequestLoad(
473     filename,
474     ImageDimensions(),
475     FittingMode::SCALE_TO_FILL,
476     SamplingMode::BOX_THEN_LINEAR,
477     TextureManager::NO_ATLAS,
478     &observer1,
479     true,
480     TextureManager::ReloadPolicy::CACHED,
481     preMultiply);
482
483   DALI_TEST_EQUALS( observer1.mLoaded, false, TEST_LOCATION );
484   DALI_TEST_EQUALS( observer1.mObserverCalled, false, TEST_LOCATION );
485
486   application.SendNotification();
487   application.Render();
488
489   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
490
491   application.SendNotification();
492   application.Render();
493
494   DALI_TEST_EQUALS( observer1.mLoaded, true, TEST_LOCATION );
495   DALI_TEST_EQUALS( observer1.mObserverCalled, true, TEST_LOCATION );
496   DALI_TEST_EQUALS( observer1.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
497
498   TestObserver observer2;
499   Devel::PixelBuffer pixelBuffer = textureManager.LoadPixelBuffer(
500     filename,
501     ImageDimensions(),
502     FittingMode::SCALE_TO_FILL,
503     SamplingMode::BOX_THEN_LINEAR,
504     false,
505     &observer2,
506     true,
507     preMultiply);
508
509   DALI_TEST_EQUALS( observer2.mLoaded, false, TEST_LOCATION );
510   DALI_TEST_EQUALS( observer2.mObserverCalled, false, TEST_LOCATION );
511
512   application.SendNotification();
513   application.Render();
514
515   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
516
517   application.SendNotification();
518   application.Render();
519
520   DALI_TEST_EQUALS( observer2.mLoaded, true, TEST_LOCATION );
521   DALI_TEST_EQUALS( observer2.mObserverCalled, true, TEST_LOCATION );
522   DALI_TEST_EQUALS( observer2.mCompleteType, TestObserver::CompleteType::LOAD_COMPLETE, TEST_LOCATION );
523
524   END_TEST;
525 }
526
527 int UtcTextureManagerUseInvalidMask(void)
528 {
529   ToolkitTestApplication application;
530   tet_infoline( "UtcTextureManagerUseInvalidMask" );
531
532   TextureManager textureManager; // Create new texture manager
533
534   TestObserver observer;
535   std::string filename( TEST_IMAGE_FILE_NAME );
536   std::string maskname("");
537   TextureManager::MaskingDataPointer maskInfo = nullptr;
538   maskInfo.reset(new TextureManager::MaskingData());
539   maskInfo->mAlphaMaskUrl = maskname;
540   maskInfo->mAlphaMaskId = TextureManager::INVALID_TEXTURE_ID;
541   maskInfo->mCropToMask = true;
542   maskInfo->mContentScaleFactor = 1.0f;
543
544   auto textureId( TextureManager::INVALID_TEXTURE_ID );
545   Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f );
546   Dali::ImageDimensions atlasRectSize( 0,0 );
547   bool synchronousLoading(false);
548   bool atlasingStatus(false);
549   bool loadingStatus(false);
550   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
551   ImageAtlasManagerPtr atlasManager = nullptr;
552   Toolkit::AtlasUploadObserver* atlasUploadObserver = nullptr;
553
554   textureManager.LoadTexture(
555     filename,
556     ImageDimensions(),
557     FittingMode::SCALE_TO_FILL,
558     SamplingMode::BOX_THEN_LINEAR,
559     maskInfo,
560     synchronousLoading,
561     textureId,
562     atlasRect,
563     atlasRectSize,
564     atlasingStatus,
565     loadingStatus,
566     WrapMode::DEFAULT,
567     WrapMode::DEFAULT,
568     &observer,
569     atlasUploadObserver,
570     atlasManager,
571     true,
572     TextureManager::ReloadPolicy::CACHED,
573     preMultiply
574   );
575
576   DALI_TEST_EQUALS( observer.mLoaded, false, TEST_LOCATION );
577   DALI_TEST_EQUALS( observer.mObserverCalled, false, TEST_LOCATION );
578
579   application.SendNotification();
580   application.Render();
581
582   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
583
584   application.SendNotification();
585   application.Render();
586
587   DALI_TEST_EQUALS( observer.mLoaded, true, TEST_LOCATION );
588   DALI_TEST_EQUALS( observer.mObserverCalled, true, TEST_LOCATION );
589   DALI_TEST_EQUALS( observer.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
590
591   END_TEST;
592 }