X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-WebView.cpp;h=86776ff6c211511b6609a80595d6f9862aec6904;hp=39ebd29581fb9dc5498b50b10d96c9ee6ba2ee7f;hb=0c8875977f6f8e8a026eacb7a9ef57d14ce8deac;hpb=5f220b834bb3bfd53bf536485069addbaada1e39 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp index 39ebd29..86776ff 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp @@ -101,6 +101,7 @@ static std::shared_ptr gContextMenuInstance = nullpt static int gContextMenuItemSelectedCallbackCalled = 0; static std::shared_ptr gContextMenuItemInstance = nullptr; static int gHitTestCreatedCallbackCalled = 0; +static int gCookieManagerChangsWatchCallbackCalled = 0; struct CallbackFunctor { @@ -204,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; @@ -1577,12 +1583,19 @@ int UtcDaliWebContextGetSetCacheModel(void) // 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(); @@ -1593,6 +1606,37 @@ int UtcDaliWebContextGetSetCacheModel(void) 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 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; } @@ -1638,7 +1682,7 @@ int UtcDaliWebContextGetWebDatabaseStorageOrigins(void) 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); @@ -1696,6 +1740,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)