Fix crash issue when favicon is null.
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-web-engine.cpp
1 /*
2  * Copyright (c) 2021 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 "toolkit-timer.h"
19
20 #include <dali/devel-api/adaptor-framework/web-engine.h>
21 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
22 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
23 #include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
24 #include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
25 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
26 #include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
27 #include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
28 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
29 #include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
30 #include <dali/devel-api/adaptor-framework/web-engine-frame.h>
31 #include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
32 #include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
33 #include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
34 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
35 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
36 #include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
37 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
38 #include <dali/public-api/adaptor-framework/native-image-source.h>
39 #include <dali/public-api/images/pixel-data.h>
40 #include <dali/public-api/object/any.h>
41 #include <dali/public-api/object/base-object.h>
42 #include <dali/public-api/object/property-map.h>
43 #include <memory>
44 #include <string.h>
45 #include <toolkit-application.h>
46
47 namespace Dali
48 {
49
50 namespace Internal
51 {
52
53 namespace Adaptor
54 {
55
56 class WebEngine;
57 class MockWebEngineContext;
58
59 namespace
60 {
61
62 // Generally only one WebEngine instance exists.
63 // If > 1, a new web engine has been created by CreateWindowSignal.
64 static WebEngine* gInstance = nullptr;
65 static int gInstanceCount = 0;
66 static MockWebEngineContext* gWebEngineContextInstance = nullptr;
67
68 bool OnGoBack();
69 bool OnGoForward();
70 bool OnLoadUrl();
71 bool OnEvaluteJavaScript();
72 bool OnJavaScriptAlert();
73 bool OnJavaScriptConfirm();
74 bool OnJavaScriptPrompt();
75 bool OnHitTestCreated();
76 bool OnScrollEdge();
77 bool OnScreenshotCaptured();
78 bool OnVideoPlaying();
79 bool OnGeolocationPermission();
80 bool OnClearHistory();
81 bool OnSecurityOriginAcquired();
82 bool OnStorageUsageAcquired();
83 bool OnFormPasswordAcquired();
84 bool OnDownloadStarted();
85 bool OnMimeOverridden();
86 bool OnChangesWatch();
87
88 static void ConnectToGlobalSignal( bool ( *func )() )
89 {
90   Dali::Timer timer = Dali::Timer::New( 0 );
91   timer.TickSignal().Connect( func );
92 }
93
94 static void DisconnectFromGlobalSignal( bool ( *func )() )
95 {
96   Dali::Timer timer = Dali::Timer::New( 0 );
97   timer.TickSignal().Disconnect( func );
98 }
99 } // namespace anonymous
100
101 class MockWebEngineContext : public Dali::WebEngineContext
102 {
103 public:
104   MockWebEngineContext()
105     : mockModel( Dali::WebEngineContext::CacheModel::DOCUMENT_VIEWER )
106   {
107   }
108
109   Dali::WebEngineContext::CacheModel GetCacheModel() const override
110   {
111     return mockModel;
112   }
113
114   void SetCacheModel( Dali::WebEngineContext::CacheModel cacheModel ) override
115   {
116     mockModel = cacheModel;
117   }
118
119   void SetProxyUri( const std::string& uri ) override
120   {
121   }
122
123   void SetDefaultProxyAuth( const std::string& username, const std::string& password ) override
124   {
125   }
126
127   void SetCertificateFilePath( const std::string& certificatePath ) override
128   {
129   }
130
131   void DeleteAllWebDatabase() override
132   {
133   }
134
135   bool GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
136   {
137     if (callback)
138     {
139       ConnectToGlobalSignal(&OnSecurityOriginAcquired);
140       mSecurityOriginAcquiredCallback = callback;
141     }
142     return true;
143   }
144
145   bool DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
146   {
147     return true;
148   }
149
150   bool GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
151   {
152     if (callback)
153     {
154       ConnectToGlobalSignal(&OnSecurityOriginAcquired);
155       mSecurityOriginAcquiredCallback = callback;
156     }
157     return true;
158   }
159
160   bool GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback) 
161   {
162     if (callback)
163     {
164       ConnectToGlobalSignal(&OnStorageUsageAcquired);
165       mStorageUsageAcquiredCallback = callback;
166     }
167     return true;
168   }
169
170   void DeleteAllWebStorage() override
171   {
172   }
173
174   bool DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
175   {
176     return true;
177   }
178
179   void DeleteLocalFileSystem() override
180   {
181   }
182
183   void ClearCache() override
184   {
185   }
186
187   bool DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
188   {
189     return true;
190   }
191
192   void GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
193   {
194     if (callback)
195     {
196       ConnectToGlobalSignal(&OnFormPasswordAcquired);
197       mFormPasswordAcquiredCallback = callback;
198     }
199   }
200
201   void RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
202   {
203     if (callback)
204     {
205       ConnectToGlobalSignal(&OnDownloadStarted);
206       mDownloadStartedCallback = callback;
207     }
208   }
209
210   void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
211   {
212     if (callback)
213     {
214       ConnectToGlobalSignal(&OnMimeOverridden);
215       mMimeOverriddenCallback = callback;
216     }
217   }
218
219   void EnableCache( bool cacheEnabled ) override
220   {
221   }
222
223   bool IsCacheEnabled() const override
224   {
225     return true;
226   }
227
228   std::string GetContextCertificateFile() const override
229   {
230     return "test";
231   }
232
233   void SetContextAppId(const std::string& appID) override
234   {
235   }
236
237   bool SetContextAppVersion(const std::string& appVersion) override
238   {
239     return true;
240   }
241
242   void SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType) override
243   {
244   }
245
246   void SetContextTimeOffset(float timeOffset) override
247   {
248   }
249
250   void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) override
251   {
252   }
253
254   void RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes) override
255   {
256   }
257
258   void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes) override
259   {
260   }
261
262   void SetDefaultZoomFactor(float zoomFactor) override
263   {
264   }
265
266   float GetContextDefaultZoomFactor() const override
267   {
268     return 0;
269   }
270
271   bool DeleteAllApplicationCache() override
272   {
273     return true;
274   }
275
276   bool DeleteAllWebIndexedDatabase() override
277   {
278     return true;
279   }
280
281   void DeleteFormPasswordDataList(const std::vector<std::string>& list) override
282   {
283   }
284
285   void DeleteAllFormPasswordData() override
286   {
287   }
288
289   void DeleteAllFormCandidateData() override
290   {
291   }
292
293   std::string GetContextProxy() const override
294   {
295     return "test";
296   }
297
298   void SetContextProxy(const std::string& proxy, const std::string& bypass) override
299   {
300   }
301
302   std::string GetProxyBypassRule() const override
303   {
304     return "test";
305   }
306
307   bool FreeUnusedMemory() override
308   {
309     return true;
310   }
311
312 public:
313   Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback mSecurityOriginAcquiredCallback;
314   Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback mStorageUsageAcquiredCallback;
315   Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback mFormPasswordAcquiredCallback;
316   Dali::WebEngineContext::WebEngineDownloadStartedCallback mDownloadStartedCallback;
317   Dali::WebEngineContext::WebEngineMimeOverriddenCallback mMimeOverriddenCallback;
318
319 private:
320   Dali::WebEngineContext::CacheModel mockModel;
321 };
322
323 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
324 {
325 public:
326   MockWebEngineCookieManager()
327     : mockCookieAcceptPolicy( Dali::WebEngineCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY )
328   {
329   }
330
331   void SetCookieAcceptPolicy( Dali::WebEngineCookieManager::CookieAcceptPolicy policy ) override
332   {
333     mockCookieAcceptPolicy = policy;
334   }
335
336   Dali::WebEngineCookieManager::CookieAcceptPolicy GetCookieAcceptPolicy() const override
337   {
338     return mockCookieAcceptPolicy;
339   }
340
341   void ClearCookies() override
342   {
343   }
344
345   void SetPersistentStorage( const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage ) override
346   {
347   }
348
349   void ChangesWatch( Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback ) override
350   {
351     if ( callback )
352     {
353       ConnectToGlobalSignal( &OnChangesWatch );
354       mChangesWatchCallback = callback;
355     }
356   }
357
358 public:
359   Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback mChangesWatchCallback;
360
361 private:
362   Dali::WebEngineCookieManager::CookieAcceptPolicy mockCookieAcceptPolicy;
363 };
364
365 class MockWebEngineBackForwardListItem : public Dali::WebEngineBackForwardListItem
366 {
367 public:
368   MockWebEngineBackForwardListItem()
369     : mockUrl( "http://url" ),
370       mockTitle( "title" ),
371       mockOriginalUrl( "http://originalurl" )
372   {
373   }
374
375   std::string GetUrl() const override
376   {
377     return mockUrl;
378   }
379
380   std::string GetTitle() const override
381   {
382     return mockTitle;
383   }
384
385   std::string GetOriginalUrl() const override
386   {
387     return mockOriginalUrl;
388   }
389
390 private:
391   std::string mockUrl;
392   std::string mockTitle;
393   std::string mockOriginalUrl;
394 };
395
396 class MockWebEngineBackForwardList : public Dali::WebEngineBackForwardList
397 {
398 public:
399   MockWebEngineBackForwardList()
400   {
401   }
402
403   std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem() const override
404   {
405     std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
406     return ret;
407   }
408
409   std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem() const override
410   {
411     std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
412     return ret;
413   }
414
415   std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem() const override
416   {
417     std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
418     return ret;
419   }
420
421   std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex( uint32_t index ) const override
422   {
423     std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
424     return ret;
425   }
426
427   uint32_t GetItemCount() const override
428   {
429     return 1;
430   }
431
432   std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit) override
433   {
434     std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> ret;
435     std::unique_ptr<Dali::WebEngineBackForwardListItem> item(new MockWebEngineBackForwardListItem());
436     ret.push_back(std::move(item));
437     return ret;
438   }
439
440   std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit) override
441   {
442     std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> ret;
443     std::unique_ptr<Dali::WebEngineBackForwardListItem> item(new MockWebEngineBackForwardListItem());
444     ret.push_back(std::move(item));
445     return ret;
446   }
447 };
448
449
450 class MockWebEngineCertificate : public Dali::WebEngineCertificate
451 {
452 public:
453   MockWebEngineCertificate()
454   {
455   }
456
457   void Allow(bool allowed) override
458   {
459   }
460
461   bool IsFromMainFrame() const override
462   {
463     return true;
464   }
465
466   std::string GetPem() const override
467   {
468     return "abc";
469   }
470
471   bool IsContextSecure() const override
472   {
473     return true;
474   }
475 };
476
477 class MockWebEngineHttpAuthHandler : public Dali::WebEngineHttpAuthHandler
478 {
479 public:
480   MockWebEngineHttpAuthHandler()
481   {
482   }
483
484   std::string GetRealm() const override
485   {
486     return "test";
487   }
488
489   void Suspend() override
490   {
491   }
492
493   void UseCredential(const std::string& user, const std::string& password) override
494   {
495   }
496
497   void CancelCredential() override
498   {
499   }
500 };
501
502 class MockWebEngineFormRepostDecision : public WebEngineFormRepostDecision
503 {
504 public:
505   MockWebEngineFormRepostDecision()
506   {
507   }
508
509   void Reply(bool allowed) override {}
510 };
511
512 class MockWebEngineFrame : public Dali::WebEngineFrame
513 {
514 public:
515   MockWebEngineFrame()
516   {
517   }
518
519   bool IsMainFrame() const override
520   {
521     return true;
522   }
523 };
524
525 class MockWebEnginePolicyDecision : public Dali::WebEnginePolicyDecision
526 {
527 public:
528   MockWebEnginePolicyDecision()
529   {
530   }
531
532   std::string GetUrl() const override
533   {
534     return "http://test.html";
535   }
536
537   std::string GetCookie() const override
538   {
539     return "test:abc";
540   }
541
542   Dali::WebEnginePolicyDecision::DecisionType GetDecisionType() const
543   {
544     return Dali::WebEnginePolicyDecision::DecisionType::USE;
545   }
546
547   std::string GetResponseMime() const
548   {
549     return "txt/xml";
550   }
551
552   int32_t GetResponseStatusCode() const
553   {
554     return 500;
555   }
556
557   Dali::WebEnginePolicyDecision::NavigationType GetNavigationType() const
558   {
559     return Dali::WebEnginePolicyDecision::NavigationType::LINK_CLICKED;
560   }
561
562   Dali::WebEngineFrame& GetFrame() const
563   {
564     return *(Dali::WebEngineFrame*)(&mockWebFrame);
565   }
566
567   std::string GetScheme() const
568   {
569     return "test";
570   }
571
572   bool Use()
573   {
574     return true;
575   }
576
577   bool Ignore()
578   {
579     return true;
580   }
581
582   bool Suspend()
583   {
584     return true;
585   }
586
587 private:
588   MockWebEngineFrame mockWebFrame;
589 };
590
591 class MockWebEngineRequestInterceptor : public WebEngineRequestInterceptor
592 {
593 public:
594   MockWebEngineRequestInterceptor()
595   {
596   }
597
598   std::string GetUrl() const override
599   {
600     return "http://test.html";
601   }
602
603   bool Ignore() override
604   {
605     return true;
606   }
607
608   bool SetResponseStatus(int statusCode, const std::string &customedStatusText) override
609   {
610     return true;
611   }
612
613   bool AddResponseHeader(const std::string &fieldName, const std::string &fieldValue) override
614   {
615     return true;
616   }
617
618   bool AddResponseBody(const std::string &body, uint32_t length) override
619   {
620     return true;
621   }
622 };
623
624 class MockWebEngineConsoleMessage : public Dali::WebEngineConsoleMessage
625 {
626 public:
627   MockWebEngineConsoleMessage()
628   {
629   }
630
631   std::string GetSource() const override
632   {
633     return "source";
634   }
635
636   uint32_t GetLine() const override
637   {
638     return 10;
639   }
640
641   SeverityLevel GetSeverityLevel() const override
642   {
643     return SeverityLevel::EMPTY;
644   }
645
646   std::string GetText() const override
647   {
648     return "This is a text.";
649   }
650 };
651
652 class MockWebEngineLoadError : public Dali::WebEngineLoadError
653 {
654 public:
655   MockWebEngineLoadError(const std::string& url)
656     : mockUrl(url)
657   {
658   }
659
660   std::string GetUrl() const override
661   {
662     return mockUrl;
663   }
664
665   ErrorCode GetCode() const override
666   {
667     return ErrorCode::UNKNOWN;
668   }
669
670   std::string GetDescription() const override
671   {
672     return "This is an error.";
673   }
674
675   ErrorType GetType() const override
676   {
677     return ErrorType::NONE;
678   }
679
680 private:
681   std::string mockUrl;
682 };
683
684 class MockWebEngineContextMenuItem : public Dali::WebEngineContextMenuItem
685 {
686 public:
687   MockWebEngineContextMenuItem()
688   {
689   }
690
691   ItemTag GetTag() const override
692   {
693     return ItemTag::NO_ACTION;
694   }
695
696   ItemType GetType() const override
697   {
698     return ItemType::ACTION;
699   }
700
701   bool IsEnabled() const override
702   {
703     return true;
704   }
705
706   std::string GetLinkUrl() const override
707   {
708     return "http://test.html";
709   }
710
711   std::string GetImageUrl() const override
712   {
713     return "http://test.jpg";
714   }
715
716   std::string GetTitle() const override
717   {
718     return "title";
719   }
720
721   std::unique_ptr<Dali::WebEngineContextMenu> GetParentMenu() const override
722   {
723     std::unique_ptr<Dali::WebEngineContextMenu> result;
724     return result;
725   }
726 };
727
728 class MockWebEngineContextMenu : public Dali::WebEngineContextMenu
729 {
730 public:
731   MockWebEngineContextMenu()
732   {
733   }
734
735   uint32_t GetItemCount() const override
736   {
737     return 1;
738   }
739
740   std::unique_ptr<Dali::WebEngineContextMenuItem> GetItemAt(uint32_t index) const override
741   {
742     std::unique_ptr<Dali::WebEngineContextMenuItem> webitem(new MockWebEngineContextMenuItem());
743     return webitem;
744   }
745
746   std::vector<std::unique_ptr<WebEngineContextMenuItem>> GetItemList() const override
747   {
748     std::vector<std::unique_ptr<WebEngineContextMenuItem>> result;
749     std::unique_ptr<Dali::WebEngineContextMenuItem> webitem(new MockWebEngineContextMenuItem());
750     result.push_back(std::move(webitem));
751     return result;
752   }
753
754   Dali::Vector2 GetPosition() const override
755   {
756     return Dali::Vector2(100, 100);
757   }
758
759   bool RemoveItem(WebEngineContextMenuItem& item) override
760   {
761     return true;
762   }
763
764   bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) override
765   {
766     return true;
767   }
768
769   bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) override
770   {
771     return true;
772   }
773
774   bool SelectItem(WebEngineContextMenuItem& item) override
775   {
776     return true;
777   }
778
779   bool Hide() override
780   {
781     return true;
782   }
783 };
784
785 class MockWebEngineHitTest : public Dali::WebEngineHitTest
786 {
787 public:
788   MockWebEngineHitTest()
789   {
790   }
791
792   ResultContext GetResultContext() const override
793   {
794     return ResultContext::DOCUMENT;
795   }
796
797   std::string GetLinkUri() const override
798   {
799     return "http://test.html";
800   }
801
802   std::string GetLinkTitle() const override
803   {
804     return "test";
805   }
806
807   std::string GetLinkLabel() const override
808   {
809     return "label";
810   }
811
812   std::string GetImageUri() const override
813   {
814     return "http://test.jpg";
815   }
816
817   std::string GetMediaUri() const override
818   {
819     return "http://test.mp4";
820   }
821
822   std::string GetTagName() const override
823   {
824     return "img";
825   }
826
827   std::string GetNodeValue() const override
828   {
829     return "test";
830   }
831
832   Dali::Property::Map& GetAttributes() const override
833   {
834     return mockAttributesMap;
835   }
836
837   std::string GetImageFileNameExtension() const override
838   {
839     return "jpg";
840   }
841
842   Dali::PixelData GetImageBuffer() override
843   {
844     uint8_t* imageData = new uint8_t[16];
845     memset(imageData, 0xff, 16);
846     return Dali::PixelData::New(imageData, 16, 2, 2,
847                                 Dali::Pixel::Format::RGBA8888,
848                                 Dali::PixelData::ReleaseFunction::DELETE_ARRAY);
849   }
850
851 private:
852   mutable Dali::Property::Map mockAttributesMap;
853 };
854
855 class MockWebEngineSecurityOrigin : public Dali::WebEngineSecurityOrigin
856 {
857 public:
858   MockWebEngineSecurityOrigin()
859     : mockUrl("https://test.html")
860     , mockPotocol("https")
861   {
862   }
863
864   std::string GetHost() const
865   {
866     return mockUrl;
867   }
868
869   std::string GetProtocol() const
870   {
871     return mockPotocol;
872   }
873
874 private:
875   std::string mockUrl;
876   std::string mockPotocol;
877 };
878
879 class MockWebEngineSettings : public WebEngineSettings
880 {
881 public:
882   MockWebEngineSettings()
883     : mockDefaultFontSize( 16 ),
884       mockJavaScriptEnabled( true ),
885       mockAutoFittingEnabled ( true ),
886       mockPluginsEnabled ( true ),
887       mockPrivateBrowsingEnabled( true ),
888       mockLinkMagnifierEnabled( true ),
889       mockKeypadWithoutUserActionUsed( true ),
890       mockAutofillPasswordFormEnabled( true ),
891       mockFormCandidateDataEnabled( true ),
892       mockTextSelectionEnabled( true ),
893       mockTextAutosizingEnable( true ),
894       mockArrowScrollEnable( true ),
895       mockClipboardEnabled( true ),
896       mockImePanelEnabled( true ),
897       mockImageLoadedAutomatically( true ),
898       mockDefaultTextEncodingName()
899   {
900   }
901
902   uint32_t GetDefaultFontSize() const override
903   {
904     return mockDefaultFontSize;
905   }
906
907   void SetDefaultFontSize( uint32_t size ) override
908   {
909     mockDefaultFontSize = size;
910   }
911
912   bool IsJavaScriptEnabled() const override
913   {
914     return mockJavaScriptEnabled;
915   }
916
917   void EnableJavaScript( bool enabled ) override
918   {
919     mockJavaScriptEnabled = enabled;
920   }
921
922   bool IsAutoFittingEnabled() const override
923   {
924     return mockAutoFittingEnabled;
925   }
926
927   void EnableAutoFitting( bool enabled ) override
928   {
929     mockAutoFittingEnabled = enabled;
930   }
931
932   bool ArePluginsEnabled() const override
933   {
934     return mockPluginsEnabled;
935   }
936
937   void EnablePlugins( bool enabled ) override
938   {
939     mockPluginsEnabled = enabled;
940   }
941
942   bool IsPrivateBrowsingEnabled() const override
943   {
944     return mockPrivateBrowsingEnabled;
945   }
946
947   void EnablePrivateBrowsing( bool enabled ) override
948   {
949     mockPrivateBrowsingEnabled = enabled;
950   }
951
952   bool IsLinkMagnifierEnabled() const override
953   {
954     return mockLinkMagnifierEnabled;
955   }
956
957   void EnableLinkMagnifier( bool enabled ) override
958   {
959     mockLinkMagnifierEnabled = enabled;
960   }
961
962   bool IsKeypadWithoutUserActionUsed() const override
963   {
964     return mockKeypadWithoutUserActionUsed;
965   }
966
967   void UseKeypadWithoutUserAction( bool used ) override
968   {
969     mockKeypadWithoutUserActionUsed = used;
970   }
971
972   bool IsAutofillPasswordFormEnabled() const override
973   {
974     return mockAutofillPasswordFormEnabled;
975   }
976
977   void EnableAutofillPasswordForm( bool enabled ) override
978   {
979     mockAutofillPasswordFormEnabled = enabled;
980   }
981
982   bool IsFormCandidateDataEnabled() const override
983   {
984     return mockFormCandidateDataEnabled;
985   }
986
987   void EnableFormCandidateData( bool enabled ) override
988   {
989     mockFormCandidateDataEnabled = enabled;
990   }
991
992   bool IsTextSelectionEnabled() const override
993   {
994     return mockTextSelectionEnabled;
995   }
996
997   void EnableTextSelection( bool enabled ) override
998   {
999     mockTextSelectionEnabled = enabled;
1000   }
1001
1002   bool IsTextAutosizingEnabled() const override
1003   {
1004     return mockTextAutosizingEnable;
1005   }
1006
1007   void EnableTextAutosizing( bool enabled ) override
1008   {
1009     mockTextAutosizingEnable = enabled;
1010   }
1011
1012   bool IsArrowScrollEnabled() const override
1013   {
1014     return mockArrowScrollEnable;
1015   }
1016
1017   void EnableArrowScroll( bool enabled ) override
1018   {
1019     mockArrowScrollEnable = enabled;
1020   }
1021
1022   bool IsClipboardEnabled() const override
1023   {
1024     return mockClipboardEnabled;
1025   }
1026
1027   void EnableClipboard( bool enabled ) override
1028   {
1029     mockClipboardEnabled = enabled;
1030   }
1031
1032   bool IsImePanelEnabled() const override
1033   {
1034     return mockImePanelEnabled;
1035   }
1036
1037   void EnableImePanel( bool enabled ) override
1038   {
1039     mockImePanelEnabled = enabled;
1040   }
1041
1042   bool AreImagesLoadedAutomatically() const override
1043   {
1044     return mockImageLoadedAutomatically;
1045   }
1046
1047   void AllowImagesLoadAutomatically( bool automatic ) override
1048   {
1049     mockImageLoadedAutomatically = automatic;
1050   }
1051
1052   std::string GetDefaultTextEncodingName() const override
1053   {
1054     return mockDefaultTextEncodingName;
1055   }
1056
1057   void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) override
1058   {
1059     mockDefaultTextEncodingName = defaultTextEncodingName;
1060   }
1061
1062   void AllowMixedContents( bool allowed ) override
1063   {
1064   }
1065
1066   void EnableSpatialNavigation( bool enabled ) override
1067   {
1068   }
1069
1070   void EnableWebSecurity( bool enabled ) override
1071   {
1072   }
1073
1074   void EnableCacheBuilder( bool enabled ) override
1075   {
1076   }
1077
1078   void UseScrollbarThumbFocusNotifications( bool used ) override
1079   {
1080   }
1081
1082   void EnableDoNotTrack( bool enabled ) override
1083   {
1084   }
1085
1086   void AllowFileAccessFromExternalUrl( bool allowed ) override
1087   {
1088   }
1089
1090   void AllowScriptsOpenWindows( bool allowed ) override
1091   {
1092   }
1093
1094   bool SetViewportMetaTag(bool enable) override
1095   {
1096     return true;
1097   }
1098
1099   bool SetForceZoom(bool enable) override
1100   {
1101     return true;
1102   }
1103
1104   bool IsZoomForced() const override
1105   {
1106     return true;
1107   }
1108
1109   bool SetTextZoomEnabled(bool enable) override
1110   {
1111     return true;
1112   }
1113
1114   bool IsTextZoomEnabled() const override
1115   {
1116     return true;
1117   }
1118
1119   void SetExtraFeature(const std::string& feature, bool enable) override
1120   {
1121   }
1122
1123   bool IsExtraFeatureEnabled(const std::string& feature) const override
1124   {
1125     return  true;
1126   }
1127
1128 private:
1129   int mockDefaultFontSize;
1130   bool mockJavaScriptEnabled;
1131   bool mockAutoFittingEnabled;
1132   bool mockPluginsEnabled;
1133   bool mockPrivateBrowsingEnabled;
1134   bool mockLinkMagnifierEnabled;
1135   bool mockKeypadWithoutUserActionUsed;
1136   bool mockAutofillPasswordFormEnabled;
1137   bool mockFormCandidateDataEnabled;
1138   bool mockTextSelectionEnabled;
1139   bool mockTextAutosizingEnable;
1140   bool mockArrowScrollEnable;
1141   bool mockClipboardEnabled;
1142   bool mockImePanelEnabled;
1143   bool mockImageLoadedAutomatically;
1144   std::string mockDefaultTextEncodingName;
1145 };
1146
1147 class WebEngine: public Dali::BaseObject
1148 {
1149 public:
1150
1151   using JavaScriptEvaluatedResultCallback = std::function<void(const std::string&)>;
1152
1153   WebEngine()
1154     : mUrl()
1155     , mCurrentPlusOnePos( 0 )
1156     , mUserAgent()
1157     , mEvaluating( false )
1158     , mScrollPosition( 0, 0 )
1159     , mScrollSize( 500, 500 )
1160     , mContentSize( 500, 500 )
1161   {
1162     gInstanceCount++;
1163     if ( gInstanceCount == 1 ) // only first web engine need be saved.
1164     {
1165       gInstance = this;
1166     }
1167
1168     mockWebEngineSettings = new MockWebEngineSettings();
1169     MockWebEngineContext* engineContext = new MockWebEngineContext();
1170     mockWebEngineContext = engineContext;
1171     if ( gInstanceCount == 1 )
1172     {
1173       gWebEngineContextInstance = engineContext;
1174     }
1175     mockWebEngineCookieManager = new MockWebEngineCookieManager();
1176     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
1177   }
1178
1179   virtual ~WebEngine()
1180   {
1181     gInstanceCount--;
1182     if( !gInstanceCount )
1183     {
1184       gInstance = 0;
1185       gWebEngineContextInstance = 0;
1186     }
1187
1188     delete mockWebEngineSettings;
1189     delete mockWebEngineContext;
1190     delete mockWebEngineCookieManager;
1191     delete mockWebEngineBackForwardList;
1192   }
1193
1194   Dali::WebEngineSettings& GetSettings() const
1195   {
1196     return *mockWebEngineSettings;
1197   }
1198
1199   Dali::WebEngineContext& GetContext() const
1200   {
1201     return *mockWebEngineContext;
1202   }
1203
1204   Dali::WebEngineCookieManager& GetCookieManager() const
1205   {
1206     return *mockWebEngineCookieManager;
1207   }
1208
1209   Dali::WebEngineBackForwardList& GetBackForwardList() const
1210   {
1211     return *mockWebEngineBackForwardList;
1212   }
1213
1214   void LoadUrl( const std::string& url )
1215   {
1216     mUrl = url;
1217     ConnectToGlobalSignal( &OnLoadUrl );
1218   }
1219
1220   const std::string& GetUrl() const
1221   {
1222     return mUrl;
1223   }
1224
1225   std::string GetTitle() const
1226   {
1227     return std::string("title");
1228   }
1229
1230   Dali::PixelData GetFavicon() const
1231   {
1232     static int testGetFaviconCount = 0;
1233     if (testGetFaviconCount == 0)
1234     {
1235       testGetFaviconCount++;
1236       uint8_t* faviconData = new uint8_t[16];
1237       memset(faviconData, 0xff, 16);
1238       return Dali::PixelData::New(faviconData, 16, 2, 2,
1239                                   Dali::Pixel::Format::RGBA8888,
1240                                   Dali::PixelData::ReleaseFunction::DELETE_ARRAY);
1241     }
1242     else
1243     {
1244       return Dali::PixelData();
1245     }
1246   }
1247
1248   bool CanGoForward() const
1249   {
1250     return mHistory.size() > mCurrentPlusOnePos;
1251   }
1252
1253   void GoForward()
1254   {
1255     ConnectToGlobalSignal( &OnGoForward );
1256   }
1257
1258   bool CanGoBack() const
1259   {
1260     return mCurrentPlusOnePos > 1;
1261   }
1262
1263   void GoBack()
1264   {
1265     ConnectToGlobalSignal( &OnGoBack );
1266   }
1267
1268   void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
1269   {
1270     if( resultHandler )
1271     {
1272       if( !mEvaluating )
1273       {
1274         ConnectToGlobalSignal( &OnEvaluteJavaScript );
1275       }
1276       mResultCallbacks.push_back( resultHandler );
1277     }
1278   }
1279
1280   void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
1281   {
1282     if ( callback )
1283     {
1284       ConnectToGlobalSignal( &OnJavaScriptAlert );
1285       mJavaScriptAlertCallback = callback;
1286     }
1287   }
1288
1289   void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
1290   {
1291     if ( callback )
1292     {
1293       ConnectToGlobalSignal( &OnJavaScriptConfirm );
1294       mJavaScriptConfirmCallback = callback;
1295     }
1296   }
1297
1298   void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
1299   {
1300     if ( callback )
1301     {
1302       ConnectToGlobalSignal( &OnJavaScriptPrompt );
1303       mJavaScriptPromptCallback = callback;
1304     }
1305   }
1306
1307   std::unique_ptr<Dali::WebEngineHitTest> CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
1308   {
1309     std::unique_ptr<Dali::WebEngineHitTest> hitTest(new MockWebEngineHitTest());
1310     return hitTest;
1311   }
1312
1313   bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
1314   {
1315     if (callback)
1316     {
1317       ConnectToGlobalSignal( &OnHitTestCreated );
1318       mHitTestCreatedCallback = callback;
1319     }
1320     return true;
1321   }
1322
1323   void ClearHistory()
1324   {
1325     ConnectToGlobalSignal( &OnClearHistory );
1326   }
1327
1328   const std::string& GetUserAgent() const
1329   {
1330     return mUserAgent;
1331   }
1332
1333   void SetUserAgent( const std::string& userAgent )
1334   {
1335     mUserAgent = userAgent;
1336   }
1337
1338   void ScrollBy( int32_t dx, int32_t dy )
1339   {
1340     mScrollPosition += Dali::Vector2( dx, dy );
1341     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
1342     {
1343       ConnectToGlobalSignal( &OnScrollEdge );
1344     }
1345   }
1346
1347   bool ScrollEdgeBy( int32_t dx, int32_t dy )
1348   {
1349     mScrollPosition += Dali::Vector2( dx, dy );
1350     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
1351     {
1352       ConnectToGlobalSignal( &OnScrollEdge );
1353     }
1354     return true;
1355   }
1356
1357   void SetScrollPosition( int32_t x, int32_t y )
1358   {
1359     mScrollPosition.x = x;
1360     mScrollPosition.y = y;
1361   }
1362
1363   Dali::Vector2 GetScrollPosition() const
1364   {
1365     return mScrollPosition;
1366   }
1367
1368   Dali::Vector2 GetScrollSize() const
1369   {
1370     return mScrollSize;
1371   }
1372
1373   Dali::Vector2 GetContentSize() const
1374   {
1375     return mContentSize;
1376   }
1377
1378   void SetPageZoomFactor(float zoomFactor)
1379   {
1380     mPageZoomFactor = zoomFactor;
1381   }
1382
1383   float GetPageZoomFactor() const
1384   {
1385     return mPageZoomFactor;
1386   }
1387
1388   void SetTextZoomFactor(float zoomFactor)
1389   {
1390     mTextZoomFactor = zoomFactor;
1391   }
1392
1393   float GetTextZoomFactor() const
1394   {
1395     return mTextZoomFactor;
1396   }
1397
1398   float GetLoadProgressPercentage() const
1399   {
1400     return 0.5f;
1401   }
1402
1403   void SetScaleFactor(float scaleFactor, Dali::Vector2 point)
1404   {
1405     mScaleFactor = scaleFactor;
1406   }
1407
1408   float GetScaleFactor() const
1409   {
1410     return mScaleFactor;
1411   }
1412
1413   Dali::PixelData GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
1414   {
1415     uint32_t bufferSize = viewArea.width * viewArea.height * 4 ;
1416     uint8_t* pixel = new uint8_t[ bufferSize ];
1417     memset(pixel, 0xff, bufferSize);
1418     return Dali::PixelData::New( pixel, bufferSize, viewArea.width, viewArea.height,
1419                                  Dali::Pixel::Format::RGBA8888,
1420                                  Dali::PixelData::ReleaseFunction::DELETE_ARRAY );
1421   }
1422
1423   bool GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
1424   {
1425     if ( callback )
1426     {
1427       ConnectToGlobalSignal( &OnScreenshotCaptured );
1428       mScreenshotCapturedCallback = callback;
1429     }
1430     return true;
1431   }
1432
1433   bool CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback)
1434   {
1435     if ( callback )
1436     {
1437       ConnectToGlobalSignal( &OnVideoPlaying );
1438       mVideoPlayingCallback = callback;
1439     }
1440     return true;
1441   }
1442
1443   void RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback)
1444   {
1445     if ( callback )
1446     {
1447       ConnectToGlobalSignal( &OnGeolocationPermission );
1448       mGeolocationPermissionCallback = callback;
1449     }
1450   }
1451
1452   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal()
1453   {
1454     return mPageLoadStartedSignal;
1455   }
1456
1457   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadInProgressSignal()
1458   {
1459     return mPageLoadInProgressSignal;
1460   }
1461
1462   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal()
1463   {
1464     return mPageLoadFinishedSignal;
1465   }
1466
1467   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal()
1468   {
1469     return mPageLoadErrorSignal;
1470   }
1471
1472   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal()
1473   {
1474     return mScrollEdgeReachedSignal;
1475   }
1476
1477   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal()
1478   {
1479     return mUrlChangedSignal;
1480   }
1481
1482   Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal()
1483   {
1484     return mFormRepostDecisionSignal;
1485   }
1486
1487   Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal()
1488   {
1489     return mFrameRenderedSignal;
1490   }
1491
1492   Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType& RequestInterceptorSignal()
1493   {
1494     return mRequestInterceptorSignal;
1495   }
1496
1497   Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal()
1498   {
1499     return mConsoleMessageSignal;
1500   }
1501
1502   Dali::WebEnginePlugin::WebEngineResponsePolicyDecisionSignalType& ResponsePolicyDecisionSignal()
1503   {
1504     return mResponsePolicyDecisionSignal;
1505   }
1506
1507   Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal()
1508   {
1509     return mCertificateConfirmSignal;
1510   }
1511
1512   Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal()
1513   {
1514     return mSslCertificateChangedSignal;
1515   }
1516
1517   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal()
1518   {
1519     return mHttpAuthHandlerSignal;
1520   }
1521
1522   Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal()
1523   {
1524     return mContextMenuCustomizedSignal;
1525   }
1526
1527   Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal()
1528   {
1529     return mContextMenuItemSelectedSignal;
1530   }
1531
1532   std::string              mUrl;
1533   std::vector<std::string> mHistory;
1534   size_t                   mCurrentPlusOnePos;
1535   std::string              mUserAgent;
1536
1537   Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadStartedSignal;
1538   Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadInProgressSignal;
1539   Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadFinishedSignal;
1540   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType           mPageLoadErrorSignal;
1541   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
1542   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType              mUrlChangedSignal;
1543   Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType      mFormRepostDecisionSignal;
1544   Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType           mFrameRenderedSignal;
1545   Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType      mRequestInterceptorSignal;
1546   Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType          mConsoleMessageSignal;
1547   Dali::WebEnginePlugin::WebEngineResponsePolicyDecisionSignalType  mResponsePolicyDecisionSignal;
1548   Dali::WebEnginePlugin::WebEngineCertificateSignalType             mCertificateConfirmSignal;
1549   Dali::WebEnginePlugin::WebEngineCertificateSignalType             mSslCertificateChangedSignal;
1550   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
1551   Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
1552   Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
1553
1554   bool  mEvaluating;
1555   float mPageZoomFactor;
1556   float mTextZoomFactor;
1557   float mScaleFactor;
1558
1559   Dali::Vector2             mScrollPosition;
1560   Dali::Vector2             mScrollSize;
1561   Dali::Vector2             mContentSize;
1562   WebEngineBackForwardList* mockWebEngineBackForwardList;
1563   WebEngineContext*         mockWebEngineContext;
1564   WebEngineCookieManager*   mockWebEngineCookieManager;
1565   WebEngineSettings*        mockWebEngineSettings;
1566
1567   std::vector<JavaScriptEvaluatedResultCallback>         mResultCallbacks;
1568   Dali::WebEnginePlugin::JavaScriptAlertCallback         mJavaScriptAlertCallback;
1569   Dali::WebEnginePlugin::JavaScriptConfirmCallback       mJavaScriptConfirmCallback;
1570   Dali::WebEnginePlugin::JavaScriptPromptCallback        mJavaScriptPromptCallback;
1571   Dali::WebEnginePlugin::ScreenshotCapturedCallback      mScreenshotCapturedCallback;
1572   Dali::WebEnginePlugin::VideoPlayingCallback            mVideoPlayingCallback;
1573   Dali::WebEnginePlugin::GeolocationPermissionCallback   mGeolocationPermissionCallback;
1574   Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback mHitTestCreatedCallback;
1575 };
1576
1577
1578 namespace
1579 {
1580
1581 bool OnGoBack()
1582 {
1583   DisconnectFromGlobalSignal( &OnGoBack );
1584
1585   if( gInstance && gInstance->CanGoBack() )
1586   {
1587     gInstance->mCurrentPlusOnePos--;
1588   }
1589   return false;
1590 }
1591
1592 bool OnGoForward()
1593 {
1594   DisconnectFromGlobalSignal( &OnGoForward );
1595
1596   if( gInstance && gInstance->CanGoForward() )
1597   {
1598     gInstance->mCurrentPlusOnePos++;
1599   }
1600   return false;
1601 }
1602
1603 bool OnLoadUrl()
1604 {
1605   DisconnectFromGlobalSignal( &OnLoadUrl );
1606
1607   if( gInstance )
1608   {
1609     if( gInstance->mHistory.size() > gInstance->mCurrentPlusOnePos )
1610     {
1611       gInstance->mHistory.erase( gInstance->mHistory.begin() + gInstance->mCurrentPlusOnePos, gInstance->mHistory.end() );
1612     }
1613     gInstance->mHistory.push_back( gInstance->mUrl );
1614     gInstance->mCurrentPlusOnePos++;
1615     gInstance->mPageLoadStartedSignal.Emit( gInstance->mUrl );
1616     gInstance->mPageLoadInProgressSignal.Emit( gInstance->mUrl );
1617     gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
1618     gInstance->mUrlChangedSignal.Emit( "http://new-test" );
1619
1620     std::shared_ptr<Dali::WebEngineFormRepostDecision> repostDecision(new MockWebEngineFormRepostDecision());
1621     gInstance->mFormRepostDecisionSignal.Emit(std::move(repostDecision));
1622     gInstance->mFrameRenderedSignal.Emit();
1623     std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor(new MockWebEngineRequestInterceptor());
1624     gInstance->mRequestInterceptorSignal.Emit(std::move(interceptor));
1625
1626     std::shared_ptr<Dali::WebEngineLoadError> error(new MockWebEngineLoadError(gInstance->mUrl));
1627     gInstance->mPageLoadErrorSignal.Emit(std::move(error));
1628     std::shared_ptr<Dali::WebEngineConsoleMessage> message(new MockWebEngineConsoleMessage());
1629     gInstance->mConsoleMessageSignal.Emit(std::move(message));
1630     std::shared_ptr<Dali::WebEnginePolicyDecision> policyDecision(new MockWebEnginePolicyDecision());
1631     gInstance->mResponsePolicyDecisionSignal.Emit(std::move(policyDecision));
1632
1633     std::shared_ptr<Dali::WebEngineCertificate> certificate(new MockWebEngineCertificate());
1634     gInstance->mCertificateConfirmSignal.Emit(std::move(certificate));
1635     std::shared_ptr<Dali::WebEngineCertificate> sslCertificate(new MockWebEngineCertificate());
1636     gInstance->mSslCertificateChangedSignal.Emit(std::move(sslCertificate));
1637     std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler(new MockWebEngineHttpAuthHandler());
1638     gInstance->mHttpAuthHandlerSignal.Emit(std::move(handler));
1639
1640     std::shared_ptr<Dali::WebEngineContextMenu> menu(new MockWebEngineContextMenu());
1641     gInstance->mContextMenuCustomizedSignal.Emit(std::move(menu));
1642     std::shared_ptr<Dali::WebEngineContextMenuItem> item(new MockWebEngineContextMenuItem());
1643     gInstance->mContextMenuItemSelectedSignal.Emit(std::move(item));
1644   }
1645   return false;
1646 }
1647
1648 bool OnScrollEdge()
1649 {
1650   DisconnectFromGlobalSignal( &OnScrollEdge );
1651
1652   if( gInstance )
1653   {
1654     gInstance->mScrollEdgeReachedSignal.Emit( Dali::WebEnginePlugin::ScrollEdge::BOTTOM );
1655   }
1656
1657   return false;
1658 }
1659
1660 bool OnEvaluteJavaScript()
1661 {
1662   DisconnectFromGlobalSignal( &OnEvaluteJavaScript );
1663
1664   if( gInstance )
1665   {
1666     for( auto& func : gInstance->mResultCallbacks )
1667     {
1668       func("undefined");
1669     }
1670     gInstance->mResultCallbacks.clear();
1671   }
1672   return false;
1673 }
1674
1675 bool OnJavaScriptAlert()
1676 {
1677   DisconnectFromGlobalSignal( &OnJavaScriptAlert );
1678   if ( gInstance )
1679   {
1680     gInstance->mJavaScriptAlertCallback( "this is an alert popup." );
1681   }
1682   return false;
1683 }
1684
1685 bool OnJavaScriptConfirm()
1686 {
1687   DisconnectFromGlobalSignal( &OnJavaScriptConfirm );
1688   if ( gInstance )
1689   {
1690     gInstance->mJavaScriptConfirmCallback( "this is a confirm popup." );
1691   }
1692   return false;
1693 }
1694
1695 bool OnJavaScriptPrompt()
1696 {
1697   DisconnectFromGlobalSignal( &OnJavaScriptPrompt );
1698   if ( gInstance )
1699   {
1700     gInstance->mJavaScriptPromptCallback( "this is a prompt pompt.", "" );
1701   }
1702   return false;
1703 }
1704
1705 bool OnScreenshotCaptured()
1706 {
1707   DisconnectFromGlobalSignal( &OnScreenshotCaptured );
1708   if ( gInstance )
1709   {
1710     uint8_t* pixel = new uint8_t[ 2 * 2 * 4 ];
1711     memset(pixel, 0xff, 2 * 2 * 4);
1712     Dali::PixelData data = Dali::PixelData::New( pixel, 2 * 2 * 4, 2, 2,
1713                                  Dali::Pixel::Format::RGBA8888,
1714                                  Dali::PixelData::ReleaseFunction::DELETE_ARRAY );
1715     gInstance->mScreenshotCapturedCallback( data );
1716   }
1717   return false;
1718 }
1719
1720 bool OnVideoPlaying()
1721 {
1722   DisconnectFromGlobalSignal( &OnVideoPlaying );
1723   if ( gInstance )
1724   {
1725     gInstance->mVideoPlayingCallback( true );
1726   }
1727   return false;
1728 }
1729
1730 bool OnGeolocationPermission()
1731 {
1732   DisconnectFromGlobalSignal( &OnGeolocationPermission );
1733   if ( gInstance )
1734   {
1735     gInstance->mGeolocationPermissionCallback( "", "" );
1736   }
1737   return false;
1738 }
1739
1740 bool OnHitTestCreated()
1741 {
1742   DisconnectFromGlobalSignal(&OnHitTestCreated);
1743   if (gInstance)
1744   {
1745     std::unique_ptr<Dali::WebEngineHitTest> test(new MockWebEngineHitTest());
1746     gInstance->mHitTestCreatedCallback(std::move(test));
1747   }
1748   return false;
1749 }
1750
1751 bool OnClearHistory()
1752 {
1753   DisconnectFromGlobalSignal( &OnClearHistory );
1754
1755   if( gInstance && gInstance->mCurrentPlusOnePos )
1756   {
1757     std::string url = gInstance->mHistory[ gInstance->mCurrentPlusOnePos - 1 ];
1758     std::vector< std::string >().swap( gInstance->mHistory );
1759     gInstance->mHistory.push_back( url );
1760     gInstance->mCurrentPlusOnePos = 1;
1761   }
1762   return false;
1763 }
1764
1765 bool OnSecurityOriginAcquired()
1766 {
1767   DisconnectFromGlobalSignal(&OnSecurityOriginAcquired);
1768   if (gWebEngineContextInstance)
1769   {
1770     std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> securityOriginList;
1771     std::unique_ptr<Dali::WebEngineSecurityOrigin> origin(new MockWebEngineSecurityOrigin());
1772     securityOriginList.push_back(std::move(origin));
1773     gWebEngineContextInstance->mSecurityOriginAcquiredCallback(securityOriginList);
1774   }
1775   return false;
1776 }
1777
1778 bool OnStorageUsageAcquired()
1779 {
1780   DisconnectFromGlobalSignal(&OnStorageUsageAcquired);
1781   if (gWebEngineContextInstance)
1782   {
1783     gWebEngineContextInstance->mStorageUsageAcquiredCallback(0);
1784   }
1785   return false;
1786 }
1787
1788 bool OnFormPasswordAcquired()
1789 {
1790   DisconnectFromGlobalSignal(&OnFormPasswordAcquired);
1791   if (gWebEngineContextInstance)
1792   {
1793     std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> formPasswordList;
1794     std::unique_ptr<Dali::WebEngineContext::PasswordData> data(new Dali::WebEngineContext::PasswordData());
1795     data->url = "http://test.html";
1796     data->useFingerprint = false;
1797     formPasswordList.push_back(std::move(data));
1798     gWebEngineContextInstance->mFormPasswordAcquiredCallback(formPasswordList);
1799   }
1800   return false;
1801 }
1802
1803 bool OnDownloadStarted()
1804 {
1805   DisconnectFromGlobalSignal(&OnDownloadStarted);
1806   if (gWebEngineContextInstance)
1807   {
1808     gWebEngineContextInstance->mDownloadStartedCallback("http://test.html");
1809   }
1810   return false;
1811 }
1812
1813 bool OnMimeOverridden()
1814 {
1815   DisconnectFromGlobalSignal(&OnMimeOverridden);
1816   if (gWebEngineContextInstance)
1817   {
1818     std::string newMime;
1819     gWebEngineContextInstance->mMimeOverriddenCallback("http://test.html", "txt/xml", newMime);
1820   }
1821   return false;
1822 }
1823
1824 bool OnChangesWatch()
1825 {
1826   DisconnectFromGlobalSignal( &OnChangesWatch );
1827
1828   if ( gInstance )
1829   {
1830     MockWebEngineCookieManager* temp = (MockWebEngineCookieManager *)(&(gInstance->GetCookieManager()));
1831     if ( temp )
1832     {
1833       temp->mChangesWatchCallback();
1834     }
1835   }
1836
1837   return false;
1838 }
1839
1840 } // namespace
1841
1842 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
1843 {
1844   DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
1845   BaseObject& handle = webEngine.GetBaseObject();
1846   return static_cast< Internal::Adaptor::WebEngine& >( handle );
1847 }
1848
1849 inline const WebEngine& GetImplementation( const Dali::WebEngine& webEngine )
1850 {
1851   DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
1852   const BaseObject& handle = webEngine.GetBaseObject();
1853   return static_cast< const Internal::Adaptor::WebEngine& >( handle );
1854 }
1855
1856 } // namespace Adaptor
1857
1858 } // namespace Internal
1859
1860 // Dali::WebEngine Implementation
1861 WebEngine::WebEngine()
1862 {
1863 }
1864
1865 WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal )
1866 : BaseHandle( internal )
1867 {
1868 }
1869
1870 WebEngine::~WebEngine()
1871 {
1872 }
1873
1874 WebEngine WebEngine::New()
1875 {
1876   Internal::Adaptor::WebEngine* baseObject = new Internal::Adaptor::WebEngine();
1877
1878   return WebEngine( baseObject );
1879 }
1880
1881 WebEngine::WebEngine( const WebEngine& WebEngine )
1882 : BaseHandle( WebEngine )
1883 {
1884 }
1885
1886 WebEngine& WebEngine::operator=( const WebEngine& webEngine )
1887 {
1888   BaseHandle::operator=( webEngine );
1889   return *this;
1890 }
1891
1892 WebEngine WebEngine::DownCast( BaseHandle handle )
1893 {
1894   return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) );
1895 }
1896
1897 void WebEngine::Create( uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId )
1898 {
1899 }
1900
1901 void WebEngine::Create( uint32_t width, uint32_t height, uint32_t argc, char** argv )
1902 {
1903 }
1904
1905 void WebEngine::Destroy()
1906 {
1907 }
1908
1909 WebEngineSettings& WebEngine::GetSettings() const
1910 {
1911   return Internal::Adaptor::GetImplementation( *this ).GetSettings();
1912 }
1913
1914 WebEngineContext& WebEngine::GetContext() const
1915 {
1916   return Internal::Adaptor::GetImplementation( *this ).GetContext();
1917 }
1918
1919 WebEngineCookieManager& WebEngine::GetCookieManager() const
1920 {
1921   return Internal::Adaptor::GetImplementation( *this ).GetCookieManager();
1922 }
1923
1924 WebEngineBackForwardList& WebEngine::GetBackForwardList() const
1925 {
1926   return Internal::Adaptor::GetImplementation( *this ).GetBackForwardList();
1927 }
1928
1929 void WebEngine::LoadUrl( const std::string& url )
1930 {
1931   return Internal::Adaptor::GetImplementation( *this ).LoadUrl( url );
1932 }
1933
1934 std::string WebEngine::GetTitle() const
1935 {
1936   return Internal::Adaptor::GetImplementation( *this ).GetTitle();
1937 }
1938
1939 Dali::PixelData WebEngine::GetFavicon() const
1940 {
1941   return Internal::Adaptor::GetImplementation( *this ).GetFavicon();
1942 }
1943
1944 const std::string& WebEngine::GetUrl()
1945 {
1946   return Internal::Adaptor::GetImplementation( *this ).GetUrl();
1947 }
1948
1949 NativeImageInterfacePtr WebEngine::GetNativeImageSource()
1950 {
1951   Any source;
1952   Dali::NativeImageSourcePtr sourcePtr = Dali::NativeImageSource::New( source );
1953   return sourcePtr;
1954 }
1955
1956 void WebEngine::LoadHtmlString( const std::string& htmlString )
1957 {
1958 }
1959
1960 bool WebEngine::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl)
1961 {
1962   return true;
1963 }
1964
1965 bool WebEngine::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri)
1966 {
1967   return true;
1968 }
1969
1970 void WebEngine::Reload()
1971 {
1972 }
1973
1974 bool WebEngine::ReloadWithoutCache()
1975 {
1976   return true;
1977 }
1978
1979 void WebEngine::StopLoading()
1980 {
1981 }
1982
1983 void WebEngine::Suspend()
1984 {
1985 }
1986
1987 void WebEngine::Resume()
1988 {
1989 }
1990
1991 void WebEngine::SuspendNetworkLoading()
1992 {
1993 }
1994
1995 void WebEngine::ResumeNetworkLoading()
1996 {
1997 }
1998
1999 bool WebEngine::AddCustomHeader(const std::string& name, const std::string& value)
2000 {
2001   return true;
2002 }
2003
2004 bool WebEngine::RemoveCustomHeader(const std::string& name)
2005 {
2006   return true;
2007 }
2008
2009 uint32_t WebEngine::StartInspectorServer(uint32_t port)
2010 {
2011   return port;
2012 }
2013
2014 bool WebEngine::StopInspectorServer()
2015 {
2016   return true;
2017 }
2018
2019 bool WebEngine::CanGoForward()
2020 {
2021   return Internal::Adaptor::GetImplementation( *this ).CanGoForward();
2022 }
2023
2024 void WebEngine::GoForward()
2025 {
2026   Internal::Adaptor::GetImplementation( *this ).GoForward();
2027 }
2028
2029 bool WebEngine::CanGoBack()
2030 {
2031   return Internal::Adaptor::GetImplementation( *this ).CanGoBack();
2032 }
2033
2034 void WebEngine::GoBack()
2035 {
2036   Internal::Adaptor::GetImplementation( *this ).GoBack();
2037 }
2038
2039 void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
2040 {
2041   Internal::Adaptor::GetImplementation( *this ).EvaluateJavaScript( script, resultHandler );
2042 }
2043
2044 void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void(const std::string&) > handler )
2045 {
2046 }
2047
2048 void WebEngine::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
2049 {
2050   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptAlertCallback( callback );
2051 }
2052
2053 void WebEngine::JavaScriptAlertReply()
2054 {
2055 }
2056
2057 void WebEngine::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
2058 {
2059   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptConfirmCallback( callback );
2060 }
2061
2062 void WebEngine::JavaScriptConfirmReply( bool confirmed )
2063 {
2064 }
2065
2066 void WebEngine::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
2067 {
2068   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptPromptCallback( callback );
2069 }
2070
2071 void WebEngine::JavaScriptPromptReply( const std::string& result )
2072 {
2073 }
2074
2075 std::unique_ptr<Dali::WebEngineHitTest> WebEngine::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
2076 {
2077   return Internal::Adaptor::GetImplementation(*this).CreateHitTest(x, y, mode);
2078 }
2079
2080 bool WebEngine::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
2081 {
2082   return Internal::Adaptor::GetImplementation(*this).CreateHitTestAsynchronously(x, y, mode, callback);
2083 }
2084
2085 void WebEngine::ClearAllTilesResources()
2086 {
2087 }
2088
2089 void WebEngine::ClearHistory()
2090 {
2091   Internal::Adaptor::GetImplementation( *this ).ClearHistory();
2092 }
2093
2094 void WebEngine::SetScaleFactor(float scaleFactor, Dali::Vector2 point)
2095 {
2096   Internal::Adaptor::GetImplementation( *this ).SetScaleFactor(scaleFactor, point);
2097 }
2098
2099 float WebEngine::GetScaleFactor() const
2100 {
2101   return Internal::Adaptor::GetImplementation( *this ).GetScaleFactor();
2102 }
2103
2104 void WebEngine::ActivateAccessibility(bool activated)
2105 {
2106 }
2107
2108 bool WebEngine::HighlightText(const std::string& text, Dali::WebEnginePlugin::FindOption options, uint32_t maxMatchCount)
2109 {
2110   return true;
2111 }
2112
2113 void WebEngine::AddDynamicCertificatePath(const std::string& host, const std::string& certPath)
2114 {
2115 }
2116
2117 Dali::PixelData WebEngine::GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
2118 {
2119   return Internal::Adaptor::GetImplementation( *this ).GetScreenshot(viewArea, scaleFactor);
2120 }
2121
2122 bool WebEngine::GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
2123 {
2124   return Internal::Adaptor::GetImplementation( *this ).GetScreenshotAsynchronously(viewArea, scaleFactor, callback);
2125 }
2126
2127 bool WebEngine::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback)
2128 {
2129   return Internal::Adaptor::GetImplementation( *this ).CheckVideoPlayingAsynchronously(callback);
2130 }
2131
2132 void WebEngine::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback)
2133 {
2134   Internal::Adaptor::GetImplementation( *this ).RegisterGeolocationPermissionCallback(callback);
2135 }
2136
2137 const std::string& WebEngine::GetUserAgent() const
2138 {
2139   return Internal::Adaptor::GetImplementation( *this ).GetUserAgent();
2140 }
2141
2142 void WebEngine::SetUserAgent( const std::string& userAgent )
2143 {
2144   Internal::Adaptor::GetImplementation( *this ).SetUserAgent( userAgent );
2145 }
2146
2147 void WebEngine::ScrollBy( int32_t dx, int32_t dy )
2148 {
2149   Internal::Adaptor::GetImplementation( *this ).ScrollBy( dx, dy );
2150 }
2151
2152 bool WebEngine::ScrollEdgeBy( int32_t dx, int32_t dy )
2153 {
2154   return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeBy( dx, dy );
2155 }
2156
2157 void WebEngine::SetScrollPosition( int32_t x, int32_t y )
2158 {
2159   Internal::Adaptor::GetImplementation( *this ).SetScrollPosition( x, y );
2160 }
2161
2162 Dali::Vector2 WebEngine::GetScrollPosition() const
2163 {
2164   return Internal::Adaptor::GetImplementation( *this ).GetScrollPosition();
2165 }
2166
2167 Dali::Vector2 WebEngine::GetScrollSize() const
2168 {
2169   return Internal::Adaptor::GetImplementation( *this ).GetScrollSize();
2170 }
2171
2172 Dali::Vector2 WebEngine::GetContentSize() const
2173 {
2174   return Internal::Adaptor::GetImplementation( *this ).GetContentSize();
2175 }
2176
2177 void WebEngine::SetSize( uint32_t width, uint32_t height )
2178 {
2179 }
2180
2181 void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color)
2182 {
2183 }
2184
2185 void WebEngine::ClearTilesWhenHidden(bool cleared)
2186 {
2187 }
2188
2189 void WebEngine::SetTileCoverAreaMultiplier(float multiplier)
2190 {
2191 }
2192
2193 void WebEngine::EnableCursorByClient(bool enabled)
2194 {
2195 }
2196
2197 std::string WebEngine::GetSelectedText() const
2198 {
2199   return "test";
2200 }
2201
2202 bool WebEngine::SendTouchEvent( const TouchEvent& touch )
2203 {
2204   return true;
2205 }
2206
2207 bool WebEngine::SendKeyEvent( const KeyEvent& event )
2208 {
2209   return true;
2210 }
2211
2212 bool WebEngine::SendHoverEvent( const HoverEvent& event )
2213 {
2214   return true;
2215 }
2216
2217 bool WebEngine::SendWheelEvent( const WheelEvent& event )
2218 {
2219   return true;
2220 }
2221
2222 void WebEngine::SetFocus( bool focused )
2223 {
2224 }
2225
2226 void WebEngine::SetPageZoomFactor(float zoomFactor)
2227 {
2228   Internal::Adaptor::GetImplementation( *this ).SetPageZoomFactor(zoomFactor);
2229 }
2230
2231 float WebEngine::GetPageZoomFactor() const
2232 {
2233   return Internal::Adaptor::GetImplementation( *this ).GetPageZoomFactor();
2234 }
2235
2236 void WebEngine::SetTextZoomFactor(float zoomFactor)
2237 {
2238   Internal::Adaptor::GetImplementation( *this ).SetTextZoomFactor(zoomFactor);
2239 }
2240
2241 float WebEngine::GetTextZoomFactor() const
2242 {
2243   return Internal::Adaptor::GetImplementation( *this ).GetTextZoomFactor();
2244 }
2245
2246 float WebEngine::GetLoadProgressPercentage() const
2247 {
2248   return Internal::Adaptor::GetImplementation( *this ).GetLoadProgressPercentage();
2249 }
2250
2251 void WebEngine::UpdateDisplayArea( Dali::Rect< int32_t > displayArea )
2252 {
2253 }
2254
2255 void WebEngine::EnableVideoHole( bool enabled )
2256 {
2257 }
2258
2259 void WebEngine::EnableMouseEvents( bool enabled )
2260 {
2261 }
2262
2263 void WebEngine::EnableKeyEvents( bool enabled )
2264 {
2265 }
2266
2267 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
2268 {
2269   return Internal::Adaptor::GetImplementation( *this ).PageLoadStartedSignal();
2270 }
2271
2272 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadInProgressSignal()
2273 {
2274   return Internal::Adaptor::GetImplementation( *this ).PageLoadInProgressSignal();
2275 }
2276
2277 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
2278 {
2279   return Internal::Adaptor::GetImplementation( *this ).PageLoadFinishedSignal();
2280 }
2281
2282 Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
2283 {
2284   return Internal::Adaptor::GetImplementation( *this ).PageLoadErrorSignal();
2285 }
2286
2287 Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
2288 {
2289   return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeReachedSignal();
2290 }
2291
2292 Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSignal()
2293 {
2294   return Internal::Adaptor::GetImplementation( *this ).UrlChangedSignal();
2295 }
2296
2297 Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
2298 {
2299   return Internal::Adaptor::GetImplementation(*this).FormRepostDecisionSignal();
2300 }
2301
2302 Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
2303 {
2304   return Internal::Adaptor::GetImplementation(*this).FrameRenderedSignal();
2305 }
2306
2307 Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType& WebEngine::RequestInterceptorSignal()
2308 {
2309   return Internal::Adaptor::GetImplementation(*this).RequestInterceptorSignal();
2310 }
2311
2312 Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& WebEngine::ConsoleMessageSignal()
2313 {
2314   return Internal::Adaptor::GetImplementation(*this).ConsoleMessageSignal();
2315 }
2316
2317 Dali::WebEnginePlugin::WebEngineResponsePolicyDecisionSignalType& WebEngine::ResponsePolicyDecisionSignal()
2318 {
2319   return Internal::Adaptor::GetImplementation(*this).ResponsePolicyDecisionSignal();
2320 }
2321
2322 Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal()
2323 {
2324   return Internal::Adaptor::GetImplementation(*this).CertificateConfirmSignal();
2325 }
2326
2327 Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal()
2328 {
2329   return Internal::Adaptor::GetImplementation(*this).SslCertificateChangedSignal();
2330 }
2331
2332 Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal()
2333 {
2334   return Internal::Adaptor::GetImplementation(*this).HttpAuthHandlerSignal();
2335 }
2336
2337 Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
2338 {
2339   return Internal::Adaptor::GetImplementation( *this ).ContextMenuCustomizedSignal();
2340 }
2341
2342 Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
2343 {
2344   return Internal::Adaptor::GetImplementation( *this ).ContextMenuItemSelectedSignal();
2345 }
2346
2347 } // namespace Dali;
2348