Add changesWatch for webview cookie
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-web-engine.cpp
index 430615d..765d015 100755 (executable)
@@ -83,6 +83,7 @@ bool OnStorageUsageAcquired();
 bool OnFormPasswordAcquired();
 bool OnDownloadStarted();
 bool OnMimeOverridden();
+bool OnChangesWatch();
 
 static void ConnectToGlobalSignal( bool ( *func )() )
 {
@@ -256,6 +257,18 @@ public:
   {
   }
 
+  void ChangesWatch( Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback ) override
+  {
+    if ( callback )
+    {
+      ConnectToGlobalSignal( &OnChangesWatch );
+      mChangesWatchCallback = callback;
+    }
+  }
+
+public:
+  Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback mChangesWatchCallback;
+
 private:
   Dali::WebEngineCookieManager::CookieAcceptPolicy mockCookieAcceptPolicy;
 };
@@ -1727,6 +1740,22 @@ bool OnMimeOverridden()
   return false;
 }
 
+bool OnChangesWatch()
+{
+  DisconnectFromGlobalSignal( &OnChangesWatch );
+
+  if ( gInstance )
+  {
+    MockWebEngineCookieManager* temp = (MockWebEngineCookieManager *)(&(gInstance->GetCookieManager()));
+    if ( temp )
+    {
+      temp->mChangesWatchCallback();
+    }
+  }
+
+  return false;
+}
+
 } // namespace
 
 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )