License conversion from Flora to Apache 2.0
[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 std::string TestPlatformAbstraction::GetDefaultFontFamily() const
164 {
165   mTrace.PushCall("GetDefaultFontFamily", "");
166   return mGetDefaultFontFamilyResult;
167 }
168
169 /**
170  * @copydoc PlatformAbstraction::GetDefaultFontSize()
171  */
172 const float TestPlatformAbstraction::GetDefaultFontSize() const
173 {
174   mTrace.PushCall("GetDefaultFontSize", "");
175   return mGetDefaultFontSizeResult;
176 }
177
178 const PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, const 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 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 std::vector<std::string> TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode ) const
341 {
342   mFontListMode = mode;
343   mTrace.PushCall("ValidateGetFontList", "");
344   std::vector<std::string> fontList;
345   return fontList;
346 }
347
348 /**
349  * @copydoc PlatformAbstraction::LoadFile()
350  */
351 bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
352 {
353   mTrace.PushCall("LoadFile", "");
354   if( mLoadFileResult.loadResult )
355   {
356     buffer = mLoadFileResult.buffer;
357   }
358
359   return mLoadFileResult.loadResult;
360 }
361
362 /**
363  * @copydoc PlatformAbstraction::SaveFile()
364  */
365 bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
366 {
367   mTrace.PushCall("SaveFile", "");
368   return false;
369 }
370
371 void TestPlatformAbstraction::JoinLoaderThreads()
372 {
373   mTrace.PushCall("JoinLoaderThreads", "");
374 }
375
376 void TestPlatformAbstraction::UpdateDefaultsFromDevice()
377 {
378   mTrace.PushCall("UpdateDefaultsFromDevice", "");
379   mGetDefaultFontFamilyResult+=1.0f;
380 }
381
382 Integration::DynamicsFactory* TestPlatformAbstraction::GetDynamicsFactory()
383 {
384   mTrace.PushCall("GetDynamicsFactory", "");
385   return NULL;
386 }
387
388 bool TestPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
389                                                           const std::string& fontStyle,
390                                                           Integration::GlobalMetrics& globalMetrics )
391 {
392   mTrace.PushCall("ReadGlobalMetricsFromCacheFile", "");
393   globalMetrics = mReadGlobalMetrics; // Want to copy contents...
394   return mReadGlobalMetricsResult; // Default false (will be set to true on subsequent write)
395 }
396
397 void TestPlatformAbstraction::WriteGlobalMetricsToCache( const std::string& fontFamily,
398                                                          const std::string& fontStyle,
399                                                          const Integration::GlobalMetrics& globalMetrics )
400 {
401   // Copy so next read uses written values. TODO: Could add method
402   // to turn this behaviour off for more extensive testing.
403   mReadGlobalMetrics = globalMetrics;
404   mReadGlobalMetricsResult = true;
405
406   mTrace.PushCall("WriteGlobalMetricsToCacheFile", "");
407 }
408
409 bool TestPlatformAbstraction::ReadMetricsFromCache( const std::string& fontFamily,
410                                                     const std::string& fontStyle,
411                                                     std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
412 {
413   mTrace.PushCall("ReadMetricsFromCacheFile", "");
414   glyphMetricsContainer = mReadMetrics;
415   return mReadMetricsResult; // Default false (will be set to true on subsequent write)
416 }
417
418 void TestPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily,
419                                                    const std::string& fontStyle,
420                                                    const Integration::GlyphSet& glyphSet )
421 {
422   // Copy so next read uses written values. TODO: Could add method
423   // to turn this behaviour off for more extensive testing.
424   const Integration::GlyphSet::CharacterList& charList =  glyphSet.GetCharacterList();
425   mReadMetrics.clear();
426   for(std::size_t i=0, end=charList.size(); i<end; ++i)
427   {
428     mReadMetrics.push_back(charList[i].second);
429   }
430   mReadMetricsResult = true;
431
432   mTrace.PushCall("WriteMetricsToCacheFile", "");
433 }
434
435
436 void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
437                                                          std::vector<std::string>& fileNames )
438 {
439   fileNames.push_back( std::string( "u1f004.png" ) );
440   fileNames.push_back( std::string( "u1f0cf.png" ) );
441   fileNames.push_back( std::string( "u1f170.png" ) );
442   fileNames.push_back( std::string( "u1f601.png" ) );
443 }
444
445
446 Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const
447 {
448   Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
449   image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 );
450
451   mTrace.PushCall("GetGlyphImage", "");
452
453   return image;
454 }
455
456
457 /** Call this every test */
458 void TestPlatformAbstraction::Initialize()
459 {
460   mTrace.Reset();
461   mTrace.Enable(true);
462   memset(&mResources, 0, sizeof(Resources));
463   memset(&mReadGlobalMetrics, 0, sizeof(Integration::GlobalMetrics));
464   mSeconds=0;
465   mMicroSeconds=0;
466   mIsLoadingResult=false;
467   mGetDefaultFontFamilyResult = "HelveticaNeue";
468   mGetDefaultFontSizeResult=12.0f;
469   mGetFontPathResult="helvetica-12";
470   mReadMetricsResult=false;
471   mReadGlobalMetricsResult=false;
472
473   if(mRequest)
474   {
475     delete mRequest;
476     mRequest = 0;
477   }
478 }
479
480
481 bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
482 {
483   switch(func)
484   {
485     case GetTimeMicrosecondsFunc:             return mTrace.FindMethod("GetTimeMicroseconds");
486     case SuspendFunc:                         return mTrace.FindMethod("Suspend");
487     case ResumeFunc:                          return mTrace.FindMethod("Resume");
488     case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
489     case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
490     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
491     case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
492     case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
493     case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
494     case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
495     case GetDefaultFontFamilyFunc:            return mTrace.FindMethod("GetDefaultFontFamily");
496     case GetDefaultFontSizeFunc:              return mTrace.FindMethod("GetDefaultFontSize");
497     case GetFontLineHeightFromCapsHeightFunc: return mTrace.FindMethod("GetFontLineHeightFromCapsHeight");
498     case GetGlyphDataFunc:                    return mTrace.FindMethod("GetGlyphData");
499     case GetCachedGlyphDataFunc:              return mTrace.FindMethod("GetCachedGlyphData");
500     case GetFontPathFunc:                     return mTrace.FindMethod("GetFontPath");
501     case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
502     case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
503     case GetFontFamilyForCharsFunc:           return mTrace.FindMethod("GetFontFamilyForChars");
504     case AllGlyphsSupportedFunc:              return mTrace.FindMethod("AllGlyphsSupported");
505     case ValidateFontFamilyNameFunc:          return mTrace.FindMethod("ValidateFontFamilyName");
506     case UpdateDefaultsFromDeviceFunc:        return mTrace.FindMethod("UpdateDefaultsFromDevice");
507     case GetDynamicsFactoryFunc:              return mTrace.FindMethod("GetDynamicsFactory");
508     case ValidateGetFontListFunc:             return mTrace.FindMethod("ValidateGetFontList");
509     case ReadGlobalMetricsFromCacheFileFunc:  return mTrace.FindMethod("ReadGlobalMetricsFromCacheFile");
510     case WriteGlobalMetricsToCacheFileFunc:   return mTrace.FindMethod("WriteGlobalMetricsToCacheFile");
511     case ReadMetricsFromCacheFileFunc:        return mTrace.FindMethod("ReadMetricsFromCacheFile");
512     case WriteMetricsToCacheFileFunc:         return mTrace.FindMethod("WriteMetricsToCacheFile");
513   }
514   return false;
515 }
516
517 void TestPlatformAbstraction::SetGetTimeMicrosecondsResult(size_t sec, size_t usec)
518 {
519   mSeconds = sec;
520   mMicroSeconds = usec;
521 }
522
523 void TestPlatformAbstraction::IncrementGetTimeResult(size_t milliseconds)
524 {
525   mMicroSeconds += milliseconds * 1000u;
526   unsigned int additionalSeconds = mMicroSeconds / 1000000u;
527
528   mSeconds += additionalSeconds;
529   mMicroSeconds -= additionalSeconds * 1000000u;
530 }
531
532 void TestPlatformAbstraction::SetIsLoadingResult(bool result)
533 {
534   mIsLoadingResult = result;
535 }
536
537 void TestPlatformAbstraction::SetGetDefaultFontFamilyResult(std::string result)
538 {
539   mGetDefaultFontFamilyResult = result;
540 }
541
542 void TestPlatformAbstraction::SetGetDefaultFontSizeResult(float result)
543 {
544   mGetDefaultFontSizeResult = result;
545 }
546
547 void TestPlatformAbstraction::SetGetFontPathResult(std::string& result)
548 {
549   mGetFontPathResult = result;
550 }
551
552 void TestPlatformAbstraction::ClearReadyResources()
553 {
554   memset(&mResources, 0, sizeof(Resources));
555 }
556
557 void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId  loadedId,
558                                                 Integration::ResourceTypeId  loadedType,
559                                                 Integration::ResourcePointer loadedResource)
560 {
561   mResources.loaded = true;
562   mResources.loadedId = loadedId;
563   mResources.loadedType = loadedType;
564   mResources.loadedResource = loadedResource;
565 }
566
567 void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
568                                                     Integration::ResourceFailure failure)
569 {
570   mResources.loadFailed = true;
571   mResources.loadFailedId = id;
572   mResources.loadFailure = failure;
573 }
574
575 void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId      savedId,
576                                                Integration::ResourceTypeId  savedType)
577 {
578   mResources.saved = true;
579   mResources.savedId = savedId;
580   mResources.savedType = savedType;
581 }
582
583 void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId  id,
584                                                     Integration::ResourceFailure failure)
585 {
586   mResources.saveFailed = true;
587   mResources.saveFailedId = id;
588   mResources.saveFailure = failure;
589 }
590
591 Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
592 {
593   return mRequest;
594 }
595
596 void TestPlatformAbstraction::DiscardRequest()
597 {
598   delete mRequest;
599   mRequest = NULL;
600 }
601
602 void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
603 {
604   mClosestSize = size;
605 }
606
607 void TestPlatformAbstraction::SetLoadFileResult( bool result, std::vector< unsigned char >& buffer )
608 {
609   mLoadFileResult.loadResult = result;
610   if( result )
611   {
612     mLoadFileResult.buffer = buffer;
613   }
614 }
615
616 void TestPlatformAbstraction::SetSaveFileResult( bool result )
617 {
618   mSaveFileResult = result;
619 }
620
621 Integration::PlatformAbstraction::FontListMode TestPlatformAbstraction::GetLastFontListMode( )
622 {
623   return mFontListMode;
624 }
625
626 void TestPlatformAbstraction::SetReadGlobalMetricsResult( bool success, Integration::GlobalMetrics& globalMetrics )
627 {
628   mReadGlobalMetricsResult = success;
629   mReadGlobalMetrics = globalMetrics;
630 }
631
632 void TestPlatformAbstraction::SetReadMetricsResult( bool success, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
633 {
634   mReadMetricsResult = success;
635   mReadMetrics = glyphMetricsContainer; // copy
636 }
637
638 } // namespace Dali