{
}
- bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+ bool DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
{
return true;
}
{
}
- void DisableCache( bool cacheDisabled ) override
- {
- }
-
void ClearCache() override
{
}
}
}
+ void EnableCache( bool cacheEnabled ) override
+ {
+ }
+
+ bool IsCacheEnabled() const override
+ {
+ return true;
+ }
+
+ std::string GetContextCertificateFile() const override
+ {
+ return "test";
+ }
+
+ void SetContextAppId(const std::string& appID) override
+ {
+ }
+
+ bool SetContextAppVersion(const std::string& appVersion) override
+ {
+ return true;
+ }
+
+ void SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType) override
+ {
+ }
+
+ void SetContextTimeOffset(float timeOffset) override
+ {
+ }
+
+ void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) override
+ {
+ }
+
+ void RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes) override
+ {
+ }
+
+ void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes) override
+ {
+ }
+
+ void SetDefaultZoomFactor(float zoomFactor) override
+ {
+ }
+
+ float GetContextDefaultZoomFactor() const override
+ {
+ return 0;
+ }
+
+ bool DeleteAllApplicationCache() override
+ {
+ return true;
+ }
+
+ bool DeleteAllWebIndexedDatabase() override
+ {
+ return true;
+ }
+
+ void DeleteFormPasswordDataList(const std::vector<std::string>& list) override
+ {
+ }
+
+ void DeleteAllFormPasswordData() override
+ {
+ }
+
+ void DeleteAllFormCandidateData() override
+ {
+ }
+
+ std::string GetContextProxy() const override
+ {
+ return "test";
+ }
+
+ void SetContextProxy(const std::string& proxy, const std::string& bypass) override
+ {
+ }
+
+ std::string GetProxyBypassRule() const override
+ {
+ return "test";
+ }
+
+ bool FreeUnusedMemory() override
+ {
+ return true;
+ }
+
public:
Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback mSecurityOriginAcquiredCallback;
Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback mStorageUsageAcquiredCallback;
// Reset something
context->SetProxyUri( kDefaultValue );
context->SetCertificateFilePath( kDefaultValue );
- context->DisableCache( false );
+ context->EnableCache( true );
context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
context->DeleteAllWebDatabase();
context->DeleteAllWebStorage();
context->DeleteLocalFileSystem();
context->ClearCache();
+ context->SetContextAppId( "id" );
+ context->SetContextApplicationType( Dali::WebEngineContext::ApplicationType::OTHER );
+ context->SetContextTimeOffset( 0 );
+ context->SetContextTimeZoneOffset( 0, 0 );
+ context->SetDefaultZoomFactor( 0 );
+ context->DeleteAllFormPasswordData();
+ context->DeleteAllFormCandidateData();
// Check default value
Dali::WebEngineContext::CacheModel value = context->GetCacheModel();
value = context->GetCacheModel();
DALI_TEST_CHECK( value == Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER );
+ // Get cache enabled
+ DALI_TEST_CHECK( context->IsCacheEnabled() );
+
+ // Get certificate
+ std::string str = context->GetContextCertificateFile();
+ DALI_TEST_EQUALS( str, "test", TEST_LOCATION );
+
+ // Set version
+ DALI_TEST_CHECK( context->SetContextAppVersion( "test" ) );
+
+ // Register
+ std::vector<std::string> temp;
+ context->RegisterUrlSchemesAsCorsEnabled( temp );
+ context->RegisterJsPluginMimeTypes( temp );
+ context->DeleteFormPasswordDataList( temp );
+
+ // Get zoom
+ DALI_TEST_EQUALS( context->GetContextDefaultZoomFactor(), float( 0 ), TEST_LOCATION );
+
+ // Delete cache and database
+ DALI_TEST_CHECK( context->DeleteAllApplicationCache() );
+ DALI_TEST_CHECK( context->DeleteAllWebIndexedDatabase() );
+
+ // Get contextProxy
+ context->SetContextProxy("", "");
+ DALI_TEST_EQUALS( context->GetContextProxy(), "test", TEST_LOCATION );
+ DALI_TEST_EQUALS( context->GetProxyBypassRule(), "test", TEST_LOCATION );
+
+ //Notify low memory
+ DALI_TEST_CHECK( context->FreeUnusedMemory() );
+
END_TEST;
}
Test::EmitGlobalTimerSignal();
DALI_TEST_EQUALS( gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION );
- result = context->DeleteWebStorageOrigin(*origin);
+ result = context->DeleteWebStorage(*origin);
DALI_TEST_CHECK( result );
result = context->DeleteApplicationCache(*origin);
mWebEngineContext.SetCertificateFilePath(certificatePath);
}
-void WebContext::DisableCache(bool cacheDisabled)
-{
- mWebEngineContext.DisableCache(cacheDisabled);
-}
-
void WebContext::SetDefaultProxyAuth(const std::string& username, const std::string& password)
{
mWebEngineContext.SetDefaultProxyAuth(username, password);
mWebEngineContext.DeleteAllWebStorage();
}
-bool WebContext::DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+bool WebContext::DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
{
- return mWebEngineContext.DeleteWebStorageOrigin(origin);
+ return mWebEngineContext.DeleteWebStorage(origin);
}
void WebContext::DeleteLocalFileSystem()
mWebEngineContext.RegisterMimeOverriddenCallback(callback);
}
+void WebContext::EnableCache(bool cacheEnabled)
+{
+ mWebEngineContext.EnableCache(cacheEnabled);
+}
+
+bool WebContext::IsCacheEnabled() const
+{
+ return mWebEngineContext.IsCacheEnabled();
+}
+
+std::string WebContext::GetContextCertificateFile() const
+{
+ return mWebEngineContext.GetContextCertificateFile();
+}
+
+void WebContext::SetContextAppId(const std::string& appID)
+{
+ mWebEngineContext.SetContextAppId(appID);
+}
+
+bool WebContext::SetContextAppVersion(const std::string& appVersion)
+{
+ return mWebEngineContext.SetContextAppVersion(appVersion);
+}
+
+void WebContext::SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
+{
+ mWebEngineContext.SetContextApplicationType(applicationType);
+}
+
+void WebContext::SetContextTimeOffset(float timeOffset)
+{
+ mWebEngineContext.SetContextTimeOffset(timeOffset);
+}
+
+void WebContext::SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
+{
+ mWebEngineContext.SetContextTimeZoneOffset(timeZoneOffset, daylightSavingTime);
+}
+
+void WebContext::RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes)
+{
+ mWebEngineContext.RegisterUrlSchemesAsCorsEnabled(schemes);
+}
+
+void WebContext::RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes)
+{
+ mWebEngineContext.RegisterJsPluginMimeTypes(mimeTypes);
+}
+
+void WebContext::SetDefaultZoomFactor(float zoomFactor)
+{
+ mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
+}
+
+float WebContext::GetContextDefaultZoomFactor() const
+{
+ return mWebEngineContext.GetContextDefaultZoomFactor();
+}
+
+bool WebContext::DeleteAllApplicationCache()
+{
+ return mWebEngineContext.DeleteAllApplicationCache();
+}
+
+bool WebContext::DeleteAllWebIndexedDatabase()
+{
+ return mWebEngineContext.DeleteAllWebIndexedDatabase();
+}
+
+void WebContext::DeleteFormPasswordDataList(const std::vector<std::string>& list)
+{
+ mWebEngineContext.DeleteFormPasswordDataList(list);
+}
+
+void WebContext::DeleteAllFormPasswordData()
+{
+ mWebEngineContext.DeleteAllFormPasswordData();
+}
+
+void WebContext::DeleteAllFormCandidateData()
+{
+ mWebEngineContext.DeleteAllFormCandidateData();
+}
+
+std::string WebContext::GetContextProxy() const
+{
+ return mWebEngineContext.GetContextProxy();
+}
+
+void WebContext::SetContextProxy(const std::string& proxy, const std::string& bypass)
+{
+ mWebEngineContext.SetContextProxy(proxy, bypass);
+}
+
+std::string WebContext::GetProxyBypassRule() const
+{
+ return mWebEngineContext.GetProxyBypassRule();
+}
+
+bool WebContext::FreeUnusedMemory()
+{
+ return mWebEngineContext.FreeUnusedMemory();
+}
+
} // namespace Toolkit
} // namespace Dali
void SetCertificateFilePath(const std::string& certificatePath);
/**
- * @brief Toggle the cache to be enabled or disabled
- *
- * Function works asynchronously.
- * By default the cache is disabled resulting in not storing network data on disk.
- *
- * @param[in] cacheDisabled enable or disable cache
- */
- void DisableCache(bool cacheDisabled);
-
- /**
* @brief Set a proxy auth credential to network backend of specific context.
*
* @param[in] username username to set
void DeleteAllWebStorage();
/**
- * @brief Delete origin that is stored in web storage db.
+ * @brief Delete web storage db.
*
* @param[in] origin origin of db
*
* @return true if succeeded, false otherwise
*/
- bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin);
+ bool DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin);
/**
* @brief Request for deleting all local file systems.
*/
void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback);
+ /**
+ * @brief Toggle the cache to be enabled or disabled
+ *
+ * @param[in] cacheEnabled enable or disable cache
+ */
+ void EnableCache(bool cacheEnabled);
+
+ /**
+ * @brief Query if the cache is enabled
+ *
+ * @return @c true is cache is enabled or @c false otherwise
+ */
+ bool IsCacheEnabled() const;
+
+ /**
+ * @brief Get CA certifcate file path
+ *
+ * It returns an internal string and should not be modified.
+ *
+ * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c null string otherwise
+ */
+ std::string GetContextCertificateFile() const;
+
+ /**
+ * @brief Set application id for @a context.
+ *
+ * @param[in] appID application id
+ */
+ void SetContextAppId(const std::string& appID);
+
+ /**
+ * @brief Set application version for @a context.
+ *
+ * @param[in] appVersion application version
+ *
+ * @return @c true if successful, @c false otherwise
+ */
+ bool SetContextAppVersion(const std::string& appVersion);
+
+ /**
+ * @brief To declare application type
+ *
+ * @param[in] applicationType The Application_Type enum
+ *
+ */
+ void SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType);
+
+ /**
+ * @brief Set time offset
+ *
+ * @param[in] timeOffset The value will be added to system time as offset
+ */
+ void SetContextTimeOffset(float timeOffset);
+
+ /**
+ * @brief Set timezone offset
+ *
+ * @param[in] timeZoneOffset offset for time zone.
+ * @param[in] daylightSavingTime The value is for daylight saving time use.
+ */
+ void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime);
+
+ /**
+ * @brief Register url schemes as CORS enabled
+ *
+ * @param[in] schemes The URL schemes list which will be added to web security policy
+ *
+ */
+ void RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes);
+
+ /**
+ * @brief Register JS plugin mime types.
+ *
+ * @param[in] mimeTypes The MIME types will be checked by the renderer frame loader
+ * to skip creating default frame for the object tags with the registered MIME type.
+ */
+ void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes);
+
+ /**
+ * @brief Set default zoom factor
+ *
+ * @param[in] zoomFactor default zoom factor
+ */
+ void SetDefaultZoomFactor(float zoomFactor);
+
+ /**
+ * @brief Get default zoom factor
+ *
+ * Gets default zoom factor for all pages opened with this context.
+ *
+ * @return @c default zoom factor or negative value on error
+ */
+ float GetContextDefaultZoomFactor() const;
+
+ /**
+ * @brief Request for deleting all web application caches.
+ *
+ * @return @c true on success, otherwise @c false
+ */
+ bool DeleteAllApplicationCache();
+
+ /**
+ * @brief Request for deleting all web indexed databases.
+ *
+ * @return @c true on success, otherwise @c false
+ */
+ bool DeleteAllWebIndexedDatabase();
+
+ /**
+ * @brief Delete a given password data list
+ *
+ * @param[in] list List with Ewk_Password_Data
+ */
+ void DeleteFormPasswordDataList(const std::vector<std::string>& list);
+
+ /**
+ * @brief Delete whole password data from DB
+ */
+ void DeleteAllFormPasswordData();
+
+ /**
+ * @brief Delete all candidate form data from DB
+ */
+ void DeleteAllFormCandidateData();
+
+ /**
+ * @brief Get the proxy URI from the network backend of specific context.
+ *
+ * @return current proxy URI or @c null string if it's not set
+ */
+ std::string GetContextProxy() const;
+
+ /**
+ * @brief Set the given proxy to network backend of specific context.
+ *
+ * @param[in] proxy URI to set
+ * @param[in] bypass rule to set
+ */
+ void SetContextProxy(const std::string& proxy, const std::string& bypass);
+
+ /**
+ * @brief Get the proxy bypass rule from the network backend of specific context.
+ *
+ * @return current proxy bypass rule or @c null string if it's not set
+ */
+ std::string GetProxyBypassRule() const;
+
+ /**
+ * @brief Notify low memory to free unused memory.
+ *
+ * @return @c true on success or @c false otherwise.
+ */
+ bool FreeUnusedMemory();
+
private:
Dali::WebEngineContext& mWebEngineContext;
};