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