Merge "Fix assetion error in FocusManager" into tizen
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-platform-abstraction.cpp
1 /*
2  * Copyright (c) 2014 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 "test-platform-abstraction.h"
19 #include "dali-test-suite-utils.h"
20 #include <dali/integration-api/bitmap.h>
21
22 namespace Dali
23 {
24
25 /**
26  * Constructor
27  */
28 TestPlatformAbstraction::TestPlatformAbstraction()
29 : mRequest(0)
30 {
31   Initialize();
32 }
33
34 /**
35  * Destructor
36  */
37 TestPlatformAbstraction::~TestPlatformAbstraction()
38 {
39 }
40
41 /**
42  * @copydoc PlatformAbstraction::GetTimeMicroseconds()
43  */
44 void TestPlatformAbstraction::GetTimeMicroseconds(unsigned int &seconds, unsigned int &microSeconds)
45 {
46   seconds = mSeconds;
47   microSeconds = mMicroSeconds;
48   mTrace.PushCall("GetTimeMicroseconds", "");
49 }
50
51 /**
52  * @copydoc PlatformAbstraction::Suspend()
53  */
54 void TestPlatformAbstraction::Suspend()
55 {
56   mTrace.PushCall("Suspend", "");
57 }
58
59 /**
60  * @copydoc PlatformAbstraction::Resume()
61  */
62 void TestPlatformAbstraction::Resume()
63 {
64   mTrace.PushCall("Resume", "");
65 }
66
67 void TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
68                                                    const ImageAttributes& attributes,
69                                                    Vector2& closestSize)
70 {
71   closestSize = mClosestSize;
72   mTrace.PushCall("GetClosestImageSize", "");
73 }
74
75 void TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
76                                                    const ImageAttributes& attributes,
77                                                    Vector2& closestSize)
78 {
79   closestSize = mClosestSize;
80   mTrace.PushCall("GetClosestImageSize", "");
81 }
82
83
84 /**
85  * @copydoc PlatformAbstraction::LoadResource()
86  */
87 void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
88 {
89   std::ostringstream out;
90   out << "Type:";
91   if( request.GetType()->id == Integration::ResourceText )
92   {
93     out << "Text";
94   }
95   else
96   {
97     out << request.GetType()->id;
98   }
99   out << ", Path: " << request.GetPath() << std::endl ;
100
101   mTrace.PushCall("LoadResource", out.str());
102   if(mRequest != NULL)
103   {
104     delete mRequest;
105     tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
106   }
107   mRequest = new Integration::ResourceRequest(request);
108 }
109
110 Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
111 {
112   mTrace.PushCall("LoadResourceSynchronously", "");
113   return mResources.loadedResource;
114 }
115
116 /**
117  * @copydoc PlatformAbstraction::SaveResource()
118  */
119 void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
120 {
121   mTrace.PushCall("SaveResource", "");
122   if(mRequest != NULL)
123   {
124     delete mRequest;
125     tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
126   }
127   mRequest = new Integration::ResourceRequest(request);
128 }
129
130 /**
131  * @copydoc PlatformAbstraction::CancelLoad()
132  */
133 void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
134 {
135   mTrace.PushCall("CancelLoad", "");
136 }
137
138 /**
139  * @copydoc PlatformAbstraction::GetResources()
140  */
141 void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
142 {
143   mTrace.PushCall("GetResources", "");
144
145   if(mResources.loaded)
146   {
147     cache.LoadResponse( mResources.loadedId, mResources.loadedType, mResources.loadedResource, Integration::RESOURCE_COMPLETELY_LOADED );
148   }
149   if(mResources.loadFailed)
150   {
151     cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
152   }
153   if(mResources.saved)
154   {
155     cache.SaveComplete( mResources.savedId, mResources.savedType );
156   }
157   if(mResources.saveFailed)
158   {
159     cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
160   }
161 }
162
163 /**
164  * @copydoc PlatformAbstraction::IsLoading()
165  */
166 bool TestPlatformAbstraction::IsLoading()
167 {
168   mTrace.PushCall("IsLoading", "");
169   return mIsLoadingResult;
170 }
171
172 /**
173  * @copydoc PlatformAbstraction::GetDefaultFontFamily()
174  */
175 const std::string& TestPlatformAbstraction::GetDefaultFontFamily() const
176 {
177   mTrace.PushCall("GetDefaultFontFamily", "");
178   return mGetDefaultFontFamilyResult;
179 }
180
181 /**
182  * @copydoc PlatformAbstraction::GetDefaultFontSize()
183  */
184 float TestPlatformAbstraction::GetDefaultFontSize() const
185 {
186   mTrace.PushCall("GetDefaultFontSize", "");
187   return mGetDefaultFontSizeResult;
188 }
189
190 PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const
191 {
192   mTrace.PushCall("GetFontLineHeightFromCapsHeight", "");
193   // LineHeight will be bigger than CapsHeight, so return capsHeight + 1
194   return PixelSize(capsHeight + 1);
195 }
196
197 /**
198  * @copydoc PlatformAbstraction::GetGlyphData()
199  */
200
201 Integration::GlyphSet* TestPlatformAbstraction::GetGlyphData ( const Integration::TextResourceType& textRequest,
202                                                                const std::string& fontFamily,
203                                                                bool getBitmap) const
204 {
205   if( getBitmap )
206   {
207     mTrace.PushCall("GetGlyphData", "getBitmap:true");
208   }
209   else
210   {
211     mTrace.PushCall("GetGlyphData", "getBitmap:false");
212   }
213
214   // It creates fake metrics for the received characters.
215
216   Integration::GlyphSet* set = new Dali::Integration::GlyphSet();
217   Integration::BitmapPtr bitmapData;
218
219   std::set<uint32_t> characters;
220
221   for( Integration::TextResourceType::CharacterList::const_iterator it = textRequest.mCharacterList.begin(), endIt = textRequest.mCharacterList.end(); it != endIt; ++it )
222   {
223     if( characters.find( it->character ) == characters.end() )
224     {
225       characters.insert( it->character );
226       Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::LOW_QUALITY,  10.0f,  10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition };
227
228       if( getBitmap )
229       {
230         bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true);
231         bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
232         PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
233         memset( pixelBuffer, it->character, 64*64 );
234       }
235
236       set->AddCharacter(bitmapData, character);
237     }
238   }
239
240   set->mLineHeight = 10.0f;
241   set->mAscender = 9.0f;
242   set->mUnitsPerEM = 2048.0f/64.0f;
243   set->SetAtlasResourceId( textRequest.mTextureAtlasId );
244   set->mFontHash = textRequest.mFontHash;
245
246   return set;
247 }
248
249 /**
250  * @copydoc PlatformAbstraction::GetCachedGlyphData()
251  */
252
253 Integration::GlyphSet* TestPlatformAbstraction::GetCachedGlyphData( const Integration::TextResourceType& textRequest,
254                                                                     const std::string& fontFamily ) const
255 {
256   mTrace.PushCall("GetCachedGlyphData", "");
257
258   // It creates fake metrics and bitmap for received numeric characters '0' through '9'.
259   Integration::GlyphSet* set = new Dali::Integration::GlyphSet();
260   Integration::BitmapPtr bitmapData;
261
262   std::set<uint32_t> characters;
263
264   for( Integration::TextResourceType::CharacterList::const_iterator it = textRequest.mCharacterList.begin(), endIt = textRequest.mCharacterList.end(); it != endIt; ++it )
265   {
266     if( it->character >= '0' && it->character <= '9' && characters.find( it->character ) == characters.end() )
267     {
268       characters.insert( it->character );
269       Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::HIGH_QUALITY,  10.0f,  10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition };
270
271       bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true);
272       bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
273       PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
274       memset( pixelBuffer, it->character, 64*64 );
275       set->AddCharacter(bitmapData, character);
276     }
277   }
278
279   set->mLineHeight = 10.0f;
280   set->mAscender = 9.0f;
281   set->mUnitsPerEM = 2048.0f/64.0f;
282   set->SetAtlasResourceId( textRequest.mTextureAtlasId );
283   set->mFontHash = textRequest.mFontHash;
284
285   return set;
286 }
287
288
289 /**
290  * @copydoc PlatformAbstraction::GetGlobalMetrics()
291  */
292 void TestPlatformAbstraction::GetGlobalMetrics( const std::string& fontFamily,
293                                                 const std::string& fontStyle,
294                                                 Integration::GlobalMetrics& globalMetrics ) const
295 {
296   globalMetrics.lineHeight = 10.0f;
297   globalMetrics.ascender = 9.0f;
298   globalMetrics.unitsPerEM = 2048.0f/64.0f;
299   globalMetrics.underlineThickness = 2.f;
300   globalMetrics.underlinePosition = 1.f;
301 }
302
303 /**
304  * @copydoc PlatformAbstraction::GetFontPath()
305  */
306 std::string TestPlatformAbstraction::GetFontPath(const std::string& family, bool bold, bool italic) const
307 {
308   mTrace.PushCall("GetFontPath", "");
309   return mGetFontPathResult;
310
311   // Do nothing with arguments
312 }
313
314 /**
315  * @copydoc PlatformAbstraction::SetDpi()
316  */
317 void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
318 {
319   mTrace.PushCall("SetDpi", "");
320 }
321
322 /**
323  * @copydoc PlatformAbstraction::GetFontFamilyForChars()
324  */
325 const std::string& TestPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
326 {
327   mTrace.PushCall("GetFontFamilyForChars", "");
328   return mGetDefaultFontFamilyResult;
329 }
330
331 /**
332  * @copydoc PlatformAbstraction::AllGlyphsSupported()
333  */
334 bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const
335 {
336   mTrace.PushCall("AllGlyphsSupported", "");
337   return true;
338 }
339
340 /**
341  * @copydoc PlatformAbstraction::ValidateFontFamilyName()
342  */
343 bool TestPlatformAbstraction::ValidateFontFamilyName(const std::string& fontFamily, const std::string& fontStyle, bool& isDefaultSystemFont, std::string& closestMatch, std::string& closestStyleMatch) const
344 {
345   mTrace.PushCall("ValidateFontFamilyName", "");
346   return true;
347 }
348
349 /**
350  * @copydoc PlatformAbstraction::GetFontList()
351  */
352 void TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fonstList ) const
353 {
354   mFontListMode = mode;
355   mTrace.PushCall("ValidateGetFontList", "");
356 }
357
358 /**
359  * @copydoc PlatformAbstraction::LoadFile()
360  */
361 bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
362 {
363   mTrace.PushCall("LoadFile", "");
364   if( mLoadFileResult.loadResult )
365   {
366     buffer = mLoadFileResult.buffer;
367   }
368
369   return mLoadFileResult.loadResult;
370 }
371
372 /**
373  * @copydoc PlatformAbstraction::SaveFile()
374  */
375 bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
376 {
377   mTrace.PushCall("SaveFile", "");
378   return false;
379 }
380
381 void TestPlatformAbstraction::JoinLoaderThreads()
382 {
383   mTrace.PushCall("JoinLoaderThreads", "");
384 }
385
386 void TestPlatformAbstraction::UpdateDefaultsFromDevice()
387 {
388   mTrace.PushCall("UpdateDefaultsFromDevice", "");
389   mGetDefaultFontFamilyResult+=1.0f;
390 }
391
392 Integration::DynamicsFactory* TestPlatformAbstraction::GetDynamicsFactory()
393 {
394   mTrace.PushCall("GetDynamicsFactory", "");
395   return NULL;
396 }
397
398 bool TestPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
399                                                           const std::string& fontStyle,
400                                                           Integration::GlobalMetrics& globalMetrics )
401 {
402   mTrace.PushCall("ReadGlobalMetricsFromCacheFile", "");
403   globalMetrics = mReadGlobalMetrics; // Want to copy contents...
404   return mReadGlobalMetricsResult; // Default false (will be set to true on subsequent write)
405 }
406
407 void TestPlatformAbstraction::WriteGlobalMetricsToCache( const std::string& fontFamily,
408                                                          const std::string& fontStyle,
409                                                          const Integration::GlobalMetrics& globalMetrics )
410 {
411   // Copy so next read uses written values. TODO: Could add method
412   // to turn this behaviour off for more extensive testing.
413   mReadGlobalMetrics = globalMetrics;
414   mReadGlobalMetricsResult = true;
415
416   mTrace.PushCall("WriteGlobalMetricsToCacheFile", "");
417 }
418
419 bool TestPlatformAbstraction::ReadMetricsFromCache( const std::string& fontFamily,
420                                                     const std::string& fontStyle,
421                                                     std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
422 {
423   mTrace.PushCall("ReadMetricsFromCacheFile", "");
424   glyphMetricsContainer = mReadMetrics;
425   return mReadMetricsResult; // Default false (will be set to true on subsequent write)
426 }
427
428 void TestPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily,
429                                                    const std::string& fontStyle,
430                                                    const Integration::GlyphSet& glyphSet )
431 {
432   // Copy so next read uses written values. TODO: Could add method
433   // to turn this behaviour off for more extensive testing.
434   const Integration::GlyphSet::CharacterList& charList =  glyphSet.GetCharacterList();
435   mReadMetrics.clear();
436   for(std::size_t i=0, end=charList.size(); i<end; ++i)
437   {
438     mReadMetrics.push_back(charList[i].second);
439   }
440   mReadMetricsResult = true;
441
442   mTrace.PushCall("WriteMetricsToCacheFile", "");
443 }
444
445
446 void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
447                                                          std::vector<std::string>& fileNames )
448 {
449   fileNames.push_back( std::string( "u1f004.png" ) );
450   fileNames.push_back( std::string( "u1f0cf.png" ) );
451   fileNames.push_back( std::string( "u1f170.png" ) );
452   fileNames.push_back( std::string( "u1f601.png" ) );
453 }
454
455
456 Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const
457 {
458   Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
459   image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 );
460
461   mTrace.PushCall("GetGlyphImage", "");
462
463   return image;
464 }
465
466
467 /** Call this every test */
468 void TestPlatformAbstraction::Initialize()
469 {
470   mTrace.Reset();
471   mTrace.Enable(true);
472   memset(&mResources, 0, sizeof(Resources));
473   memset(&mReadGlobalMetrics, 0, sizeof(Integration::GlobalMetrics));
474   mSeconds=0;
475   mMicroSeconds=0;
476   mIsLoadingResult=false;
477   mGetDefaultFontFamilyResult = "HelveticaNeue";
478   mGetDefaultFontSizeResult=12.0f;
479   mGetFontPathResult="helvetica-12";
480   mReadMetricsResult=false;
481   mReadGlobalMetricsResult=false;
482
483   if(mRequest)
484   {
485     delete mRequest;
486     mRequest = 0;
487   }
488 }
489
490
491 bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
492 {
493   switch(func)
494   {
495     case GetTimeMicrosecondsFunc:             return mTrace.FindMethod("GetTimeMicroseconds");
496     case SuspendFunc:                         return mTrace.FindMethod("Suspend");
497     case ResumeFunc:                          return mTrace.FindMethod("Resume");
498     case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
499     case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
500     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
501     case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
502     case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
503     case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
504     case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
505     case GetDefaultFontFamilyFunc:            return mTrace.FindMethod("GetDefaultFontFamily");
506     case GetDefaultFontSizeFunc:              return mTrace.FindMethod("GetDefaultFontSize");
507     case GetFontLineHeightFromCapsHeightFunc: return mTrace.FindMethod("GetFontLineHeightFromCapsHeight");
508     case GetGlyphDataFunc:                    return mTrace.FindMethod("GetGlyphData");
509     case GetCachedGlyphDataFunc:              return mTrace.FindMethod("GetCachedGlyphData");
510     case GetFontPathFunc:                     return mTrace.FindMethod("GetFontPath");
511     case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
512     case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
513     case GetFontFamilyForCharsFunc:           return mTrace.FindMethod("GetFontFamilyForChars");
514     case AllGlyphsSupportedFunc:              return mTrace.FindMethod("AllGlyphsSupported");
515     case ValidateFontFamilyNameFunc:          return mTrace.FindMethod("ValidateFontFamilyName");
516     case UpdateDefaultsFromDeviceFunc:        return mTrace.FindMethod("UpdateDefaultsFromDevice");
517     case GetDynamicsFactoryFunc:              return mTrace.FindMethod("GetDynamicsFactory");
518     case ValidateGetFontListFunc:             return mTrace.FindMethod("ValidateGetFontList");
519     case ReadGlobalMetricsFromCacheFileFunc:  return mTrace.FindMethod("ReadGlobalMetricsFromCacheFile");
520     case WriteGlobalMetricsToCacheFileFunc:   return mTrace.FindMethod("WriteGlobalMetricsToCacheFile");
521     case ReadMetricsFromCacheFileFunc:        return mTrace.FindMethod("ReadMetricsFromCacheFile");
522     case WriteMetricsToCacheFileFunc:         return mTrace.FindMethod("WriteMetricsToCacheFile");
523   }
524   return false;
525 }
526
527 void TestPlatformAbstraction::SetGetTimeMicrosecondsResult(size_t sec, size_t usec)
528 {
529   mSeconds = sec;
530   mMicroSeconds = usec;
531 }
532
533 void TestPlatformAbstraction::IncrementGetTimeResult(size_t milliseconds)
534 {
535   mMicroSeconds += milliseconds * 1000u;
536   unsigned int additionalSeconds = mMicroSeconds / 1000000u;
537
538   mSeconds += additionalSeconds;
539   mMicroSeconds -= additionalSeconds * 1000000u;
540 }
541
542 void TestPlatformAbstraction::SetIsLoadingResult(bool result)
543 {
544   mIsLoadingResult = result;
545 }
546
547 void TestPlatformAbstraction::SetGetDefaultFontFamilyResult(std::string result)
548 {
549   mGetDefaultFontFamilyResult = result;
550 }
551
552 void TestPlatformAbstraction::SetGetDefaultFontSizeResult(float result)
553 {
554   mGetDefaultFontSizeResult = result;
555 }
556
557 void TestPlatformAbstraction::SetGetFontPathResult(std::string& result)
558 {
559   mGetFontPathResult = result;
560 }
561
562 void TestPlatformAbstraction::ClearReadyResources()
563 {
564   memset(&mResources, 0, sizeof(Resources));
565 }
566
567 void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId  loadedId,
568                                                 Integration::ResourceTypeId  loadedType,
569                                                 Integration::ResourcePointer loadedResource)
570 {
571   mResources.loaded = true;
572   mResources.loadedId = loadedId;
573   mResources.loadedType = loadedType;
574   mResources.loadedResource = loadedResource;
575 }
576
577 void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
578                                                     Integration::ResourceFailure failure)
579 {
580   mResources.loadFailed = true;
581   mResources.loadFailedId = id;
582   mResources.loadFailure = failure;
583 }
584
585 void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId      savedId,
586                                                Integration::ResourceTypeId  savedType)
587 {
588   mResources.saved = true;
589   mResources.savedId = savedId;
590   mResources.savedType = savedType;
591 }
592
593 void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId  id,
594                                                     Integration::ResourceFailure failure)
595 {
596   mResources.saveFailed = true;
597   mResources.saveFailedId = id;
598   mResources.saveFailure = failure;
599 }
600
601 Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
602 {
603   return mRequest;
604 }
605
606 void TestPlatformAbstraction::DiscardRequest()
607 {
608   delete mRequest;
609   mRequest = NULL;
610 }
611
612 void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
613 {
614   mClosestSize = size;
615 }
616
617 void TestPlatformAbstraction::SetLoadFileResult( bool result, std::vector< unsigned char >& buffer )
618 {
619   mLoadFileResult.loadResult = result;
620   if( result )
621   {
622     mLoadFileResult.buffer = buffer;
623   }
624 }
625
626 void TestPlatformAbstraction::SetSaveFileResult( bool result )
627 {
628   mSaveFileResult = result;
629 }
630
631 Integration::PlatformAbstraction::FontListMode TestPlatformAbstraction::GetLastFontListMode( )
632 {
633   return mFontListMode;
634 }
635
636 void TestPlatformAbstraction::SetReadGlobalMetricsResult( bool success, Integration::GlobalMetrics& globalMetrics )
637 {
638   mReadGlobalMetricsResult = success;
639   mReadGlobalMetrics = globalMetrics;
640 }
641
642 void TestPlatformAbstraction::SetReadMetricsResult( bool success, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
643 {
644   mReadMetricsResult = success;
645   mReadMetrics = glyphMetricsContainer; // copy
646 }
647
648 } // namespace Dali