Add changesWatch for webview cookie
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-WebView.cpp
index 75f6977..a4ae7e1 100755 (executable)
 #include "dali-toolkit-test-utils/toolkit-timer.h"
 
 #include <dali.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-frame.h>
+#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
 
@@ -69,7 +75,7 @@ static bool gTouched = false;
 static bool gHovered = false;
 static bool gWheelEventHandled = false;
 static int gFormRepostDecisionCallbackCalled = 0;
-static std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> gFormRepostDecisionInstance = nullptr;
+static std::shared_ptr<Dali::WebEngineFormRepostDecision> gFormRepostDecisionInstance = nullptr;
 static int gFrameRenderedCallbackCalled = 0;
 static int gRequestInterceptorCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineRequestInterceptor> gRequestInterceptorInstance = nullptr;
@@ -77,6 +83,25 @@ static int gConsoleMessageCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineConsoleMessage> gConsoleMessageInstance = nullptr;
 static int gPolicyDecisionCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEnginePolicyDecision> gPolicyDecisionInstance = nullptr;
+static int gCertificateConfirmCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gCertificateConfirmInstance = nullptr;
+static int gSslCertificateChangedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
+static int gHttpAuthHandlerCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
+static int gSecurityOriginsAcquiredCallbackCalled = 0;
+static int gStorageUsageAcquiredCallbackCalled = 0;
+static int gFormPasswordsAcquiredCallbackCalled = 0;
+static int gDownloadStartedCallbackCalled = 0;
+static int gMimeOverriddenCallbackCalled = 0;
+static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
+static std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> gPasswordDataList;
+static int gContextMenuCustomizedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenu> gContextMenuInstance = nullptr;
+static int gContextMenuItemSelectedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenuItem> gContextMenuItemInstance = nullptr;
+static int gHitTestCreatedCallbackCalled = 0;
+static int gCookieManagerChangsWatchCallbackCalled = 0;
 
 struct CallbackFunctor
 {
@@ -123,6 +148,12 @@ static void OnUrlChanged( WebView view, const std::string& url )
   gUrlChangedCallbackCalled++;
 }
 
+static bool OnHitTestCreated(std::unique_ptr<Dali::WebEngineHitTest> test)
+{
+  gHitTestCreatedCallbackCalled++;
+  return true;
+}
+
 static void OnPageLoadError(WebView view, std::shared_ptr<Dali::WebEngineLoadError> error)
 {
   gPageLoadErrorCallbackCalled++;
@@ -154,7 +185,7 @@ static bool OnJavaScriptPrompt( const std::string& meesage1, const std::string&
 
 static void OnScreenshotCaptured(Dali::Toolkit::ImageView)
 {
-  gScreenshotCapturedCallbackCalled++;\r
+  gScreenshotCapturedCallbackCalled++;
 }
 
 static void OnVideoPlaying(bool isPlaying)
@@ -174,6 +205,11 @@ static bool OnTouched( Actor actor, const Dali::TouchEvent& touch )
   return true;
 }
 
+static void OnChangesWatch()
+{
+  gCookieManagerChangsWatchCallbackCalled++;
+}
+
 static bool OnHovered( Actor actor, const Dali::HoverEvent& hover )
 {
   gHovered = true;
@@ -186,7 +222,7 @@ static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheel )
   return true;
 }
 
-static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> decision)
+static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::WebEngineFormRepostDecision> decision)
 {
   gFormRepostDecisionCallbackCalled++;
   gFormRepostDecisionInstance = std::move(decision);
@@ -209,6 +245,66 @@ static void OnConsoleMessage(WebView view, std::shared_ptr<Dali::WebEngineConsol
   gConsoleMessageInstance = std::move(message);
 }
 
+static void OnCertificateConfirm(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+  gCertificateConfirmCallbackCalled++;
+  gCertificateConfirmInstance = std::move(certificate);
+}
+
+static void OnSslCertificateChanged(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+  gSslCertificateChangedCallbackCalled++;
+  gSslCertificateInstance = std::move(certificate);
+}
+
+static void OnHttpAuthHandler( WebView view, std::shared_ptr<Dali::WebEngineHttpAuthHandler> hander )
+{
+  gHttpAuthHandlerCallbackCalled++;
+  gHttpAuthInstance = std::move(hander);
+}
+
+static void OnSecurityOriginsAcquired(std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>>& origins)
+{
+  gSecurityOriginsAcquiredCallbackCalled++;
+  gSecurityOriginList.clear();
+  gSecurityOriginList.swap(origins);
+}
+
+static void OnStorageUsageAcquired(uint64_t usage)
+{
+  gStorageUsageAcquiredCallbackCalled++;
+}
+
+static void OnFormPasswordsAcquired(std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>>& passwords)
+{
+  gFormPasswordsAcquiredCallbackCalled++;
+  gPasswordDataList.clear();
+  gPasswordDataList.swap(passwords);
+}
+
+static void OnDownloadStarted(const std::string& url)
+{
+  gDownloadStartedCallbackCalled++;
+}
+
+static bool OnMimeOverridden(const std::string&, const std::string&, std::string&)
+{
+  gMimeOverriddenCallbackCalled++;
+  return false;
+}
+
+static void OnContextMenuCustomized(WebView view, std::shared_ptr<Dali::WebEngineContextMenu> menu)
+{
+  gContextMenuCustomizedCallbackCalled++;
+  gContextMenuInstance = std::move(menu);
+}
+
+static void OnContextMenuItemSelected(WebView view, std::shared_ptr<Dali::WebEngineContextMenuItem> item)
+{
+  gContextMenuItemSelectedCallbackCalled++;
+  gContextMenuItemInstance = std::move(item);
+}
+
 } // namespace
 
 void web_view_startup(void)
@@ -738,6 +834,65 @@ int UtcDaliWebViewFormRepostDecisionFrameRendering(void)
   END_TEST;
 }
 
+int UtcDaliWebViewSslCertificateHttpAuthentication(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+  view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+  application.GetScene().Add( view );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( view );
+
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.CertificateConfirmSignal().Connect(&OnCertificateConfirm);
+  view.SslCertificateChangedSignal().Connect(&OnSslCertificateChanged);
+  view.HttpAuthHandlerSignal().Connect(&OnHttpAuthHandler);
+  bool signal1 = false;
+  bool signal2 = false;
+  bool signal3 = false;
+  view.ConnectSignal( testTracker, "certificateConfirm", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "sslCertificateChanged", CallbackFunctor(&signal2) );
+  view.ConnectSignal( testTracker, "httpAuthRequest", CallbackFunctor(&signal3) );
+  DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 0, TEST_LOCATION );
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 & signal2 & signal3);
+
+  // certificate.
+  DALI_TEST_CHECK(gCertificateConfirmInstance);
+  gCertificateConfirmInstance->Allow(true);
+  DALI_TEST_CHECK(gCertificateConfirmInstance->IsFromMainFrame());
+
+  DALI_TEST_CHECK(gSslCertificateInstance);
+  DALI_TEST_EQUALS(gSslCertificateInstance->GetPem(), "abc", TEST_LOCATION);
+  DALI_TEST_CHECK(gSslCertificateInstance->IsContextSecure());
+
+  // http authentication.
+  DALI_TEST_CHECK(gHttpAuthInstance);
+  gHttpAuthInstance->Suspend();
+  gHttpAuthInstance->UseCredential("", "");
+  gHttpAuthInstance->CancelCredential();
+  DALI_TEST_EQUALS(gHttpAuthInstance->GetRealm(), "test", TEST_LOCATION);
+
+  // reset
+  gCertificateConfirmInstance = nullptr;
+  gSslCertificateInstance = nullptr;
+  gHttpAuthInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewGetWebBackForwardList(void)
 {
   ToolkitTestApplication application;
@@ -913,6 +1068,67 @@ int UtcDaliWebViewPropertyTitleFavicon(void)
   END_TEST;
 }
 
+int UtcDaliWebViewContextMenuCustomizedAndItemSelected(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.ContextMenuCustomizedSignal().Connect( &OnContextMenuCustomized );
+  view.ContextMenuItemSelectedSignal().Connect( &OnContextMenuItemSelected );
+  bool signal1 = false;
+  bool signal2 = false;
+  view.ConnectSignal( testTracker, "contextMenuCustomized", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "contextMenuItemSelected", CallbackFunctor(&signal2) );
+  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_CHECK(gContextMenuInstance == 0);
+  DALI_TEST_CHECK(gContextMenuItemInstance == 0);
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 );
+  DALI_TEST_CHECK( signal2 );
+
+  // check context meun & its items.
+  DALI_TEST_CHECK(gContextMenuInstance != 0);
+  std::unique_ptr<Dali::WebEngineContextMenuItem> item = gContextMenuInstance->GetItemAt(0);
+  DALI_TEST_CHECK(item.get() != 0);
+  std::vector<std::unique_ptr<Dali::WebEngineContextMenuItem>> itemList = gContextMenuInstance->GetItemList();
+  DALI_TEST_CHECK(itemList.size() == 1);
+  Dali::Vector2 testPosition = Dali::Vector2(100, 100);
+  DALI_TEST_EQUALS(gContextMenuInstance->GetPosition(), testPosition, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuInstance->RemoveItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuInstance->AppendItemAsAction(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", false));
+  DALI_TEST_CHECK(gContextMenuInstance->AppendItem(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", "", false));
+  DALI_TEST_CHECK(gContextMenuInstance->SelectItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuInstance->Hide());
+
+  DALI_TEST_CHECK(gContextMenuItemInstance != 0);
+  Dali::WebEngineContextMenuItem::ItemTag testItemTag = Dali::WebEngineContextMenuItem::ItemTag::NO_ACTION;
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTag(), testItemTag, TEST_LOCATION);
+  Dali::WebEngineContextMenuItem::ItemType testItemType = Dali::WebEngineContextMenuItem::ItemType::ACTION;
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetType(), testItemType, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuItemInstance->IsEnabled());
+  std::string testLinkUrl("http://test.html");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetLinkUrl(), testLinkUrl, TEST_LOCATION);
+  std::string testImageUrl("http://test.jpg");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetImageUrl(), testImageUrl, TEST_LOCATION);
+  std::string testTitle("title");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTitle(), testTitle, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuItemInstance->GetParentMenu().get() == 0);
+
+  gContextMenuInstance = nullptr;
+  gContextMenuItemInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewScrollBy(void)
 {
   ToolkitTestApplication application;
@@ -1133,6 +1349,50 @@ int UtcDaliWebViewPolicyDecisionRequest(void)
   END_TEST;
 }
 
+int UtcDaliWebViewHitTest(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  view.LoadUrl( TEST_URL1 );
+
+  // sync hit test.
+  std::unique_ptr<Dali::WebEngineHitTest> hitTest = view.CreateHitTest(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT);
+  DALI_TEST_CHECK(hitTest != 0);
+  DALI_TEST_EQUALS(hitTest->GetResultContext(), Dali::WebEngineHitTest::ResultContext::DOCUMENT, TEST_LOCATION);
+  std::string testLinkUri("http://test.html");
+  DALI_TEST_EQUALS(hitTest->GetLinkUri(), testLinkUri, TEST_LOCATION);
+  std::string testLinkTitle("test");
+  DALI_TEST_EQUALS(hitTest->GetLinkTitle(), testLinkTitle, TEST_LOCATION);
+  std::string testLinkLabel("label");
+  DALI_TEST_EQUALS(hitTest->GetLinkLabel(), testLinkLabel, TEST_LOCATION);
+  std::string testImageUri("http://test.jpg");
+  DALI_TEST_EQUALS(hitTest->GetImageUri(), testImageUri, TEST_LOCATION);
+  std::string testMediaUri("http://test.mp4");
+  DALI_TEST_EQUALS(hitTest->GetMediaUri(), testMediaUri, TEST_LOCATION);
+  std::string testTagName("img");
+  DALI_TEST_EQUALS(hitTest->GetTagName(), testTagName, TEST_LOCATION);
+  std::string testNodeValue("test");
+  DALI_TEST_EQUALS(hitTest->GetNodeValue(), testNodeValue, TEST_LOCATION);
+  Dali::Property::Map* testMap = &hitTest->GetAttributes();
+  DALI_TEST_CHECK(testMap);
+  std::string testImageFileNameExtension("jpg");
+  DALI_TEST_EQUALS(hitTest->GetImageFileNameExtension(), testImageFileNameExtension, TEST_LOCATION);
+  Dali::PixelData testImageBuffer = hitTest->GetImageBuffer();
+  DALI_TEST_CHECK((int)testImageBuffer.GetWidth() == 2 && (int)testImageBuffer.GetHeight() == 2);
+
+  // async...
+  bool result = view.CreateHitTestAsynchronously(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT, &OnHitTestCreated);
+  DALI_TEST_CHECK(result);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gHitTestCreatedCallbackCalled, 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliWebViewEvaluteJavaScript(void)
 {
   ToolkitTestApplication application;
@@ -1273,9 +1533,15 @@ int UtcDaliWebBackForwardListCheckItem(void)
   unsigned int itemCount = bfList->GetItemCount();
   DALI_TEST_CHECK( itemCount == 1 )
 
-  Dali::Toolkit::WebBackForwardListItem* citem = bfList->GetCurrentItem();
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citem = bfList->GetCurrentItem();
   DALI_TEST_CHECK( citem != 0 );
 
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citemP = bfList->GetPreviousItem();
+  DALI_TEST_CHECK( citemP != 0 );
+
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citemN = bfList->GetNextItem();
+  DALI_TEST_CHECK( citemN != 0 );
+
   const std::string kDefaultUrl( "http://url" );
   std::string testValue = citem->GetUrl();
   DALI_TEST_EQUALS( testValue, kDefaultUrl, TEST_LOCATION );
@@ -1288,9 +1554,15 @@ int UtcDaliWebBackForwardListCheckItem(void)
   testValue = citem->GetOriginalUrl();
   DALI_TEST_EQUALS( testValue, kDefaultOriginalUrl, TEST_LOCATION );
 
-  Dali::Toolkit::WebBackForwardListItem* item = bfList->GetItemAtIndex( 0 );
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> item = bfList->GetItemAtIndex( 0 );
   DALI_TEST_CHECK( item != 0 );
 
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecBack = bfList->GetBackwardItems(-1);
+  DALI_TEST_CHECK( vecBack.size() == 1 );
+
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecForward = bfList->GetForwardItems(-1);
+  DALI_TEST_CHECK( vecForward.size() == 1 );
+
   END_TEST;
 }
 
@@ -1313,8 +1585,8 @@ int UtcDaliWebContextGetSetCacheModel(void)
   context->SetCertificateFilePath( kDefaultValue );
   context->DisableCache( false );
   context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
-  context->DeleteWebDatabase();
-  context->DeleteWebStorage();
+  context->DeleteAllWebDatabase();
+  context->DeleteAllWebStorage();
   context->DeleteLocalFileSystem();
   context->ClearCache();
 
@@ -1330,6 +1602,76 @@ int UtcDaliWebContextGetSetCacheModel(void)
   END_TEST;
 }
 
+int UtcDaliWebContextGetWebDatabaseStorageOrigins(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebContext* context = view.GetContext();
+  DALI_TEST_CHECK( context != 0 )
+
+  std::string kDefaultValue;
+
+  // get origins of web database
+  bool result = context->GetWebDatabaseOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  Dali::WebEngineSecurityOrigin* origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->DeleteWebDatabase(*origin);
+  DALI_TEST_CHECK( result );
+
+  // get origins of web storage
+  result = context->GetWebStorageOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 2, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->GetWebStorageUsageForOrigin(*origin, &OnStorageUsageAcquired);
+  DALI_TEST_CHECK( result );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION );
+
+  result = context->DeleteWebStorageOrigin(*origin);
+  DALI_TEST_CHECK( result );
+
+  result = context->DeleteApplicationCache(*origin);
+  DALI_TEST_CHECK( result );
+
+  // form passwords, download state, mime type.
+  context->GetFormPasswordList(&OnFormPasswordsAcquired);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gFormPasswordsAcquiredCallbackCalled, 1, TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList.size() == 1);
+  DALI_TEST_EQUALS(gPasswordDataList[0]->url, "http://test.html", TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList[0]->useFingerprint == false);
+
+  context->RegisterDownloadStartedCallback(&OnDownloadStarted);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gDownloadStartedCallbackCalled, 1, TEST_LOCATION);
+
+  context->RegisterMimeOverriddenCallback(&OnMimeOverridden);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gMimeOverriddenCallbackCalled, 1, TEST_LOCATION);
+
+  gSecurityOriginList.clear();
+  gPasswordDataList.clear();
+
+  END_TEST;
+}
+
 // test cases for web cookie manager.
 
 int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
@@ -1360,6 +1702,23 @@ int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
   END_TEST;
 }
 
+int UtcDaliWebCookieManagerChangesWatch(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
+  DALI_TEST_CHECK( cookieManager != 0 )
+
+  cookieManager->ChangesWatch(&OnChangesWatch);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gCookieManagerChangsWatchCallbackCalled, 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
 // test cases for web settings.
 
 int UtcDaliWebSettingsGetSetDefaultFontSize(void)
@@ -1871,3 +2230,78 @@ int UtcDaliWebSettingsGetSetDefaultTextEncodingName(void)
   END_TEST;
 }
 
+int UtcDaliWebSettingsSetViewportMetaTag(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetViewportMetaTag(true);
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetForceZoom(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetForceZoom(true);
+  DALI_TEST_CHECK( value );
+
+  value = settings->IsZoomForced();
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetTextZoomEnabled(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetTextZoomEnabled(true);
+  DALI_TEST_CHECK( value );
+
+  value = settings->IsTextZoomEnabled();
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetExtraFeature(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  settings->SetExtraFeature("test", true);
+  bool value = settings->IsExtraFeatureEnabled("test");
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+