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=b92cea61432e4b56c82685579e9e309847b27913;hp=30693fc920d6cbe031f633dd8f3ea1df04406d84;hb=HEAD;hpb=e1dfa20fee127dd3bcfabf0c9f1aea6b5dd99f5e diff --git a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp old mode 100755 new mode 100644 index 30693fc..2ede899 --- a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,9 +29,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -79,6 +79,7 @@ static int gConso static std::unique_ptr gConsoleMessageInstance = nullptr; static int gResponsePolicyDecidedCallbackCalled = 0; static int gNavigationPolicyDecidedCallbackCalled = 0; +static int gNewWindowCreatedCallbackCalled = 0; static std::unique_ptr gResponsePolicyDecisionInstance = nullptr; static int gCertificateConfirmCallbackCalled = 0; static std::unique_ptr gCertificateConfirmInstance = nullptr; @@ -148,6 +149,13 @@ static void OnNavigationPolicyDecided(std::unique_ptrRegisterRequestInterceptedCallback(&OnRequestIntercepted); DALI_TEST_EQUALS(gRequestInterceptedCallbackCalled, 0, TEST_LOCATION); @@ -1674,6 +1706,11 @@ int UtcDaliWebContextHttpRequestInterceptor(void) DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponseBody((const int8_t*)"test", 4)); DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponse("key:value", (const int8_t*)"test", 4)); DALI_TEST_CHECK(gRequestInterceptorInstance->WriteResponseChunk((const int8_t*)"test", 4)); + + DALI_TEST_CHECK(gRequestInterceptorInstance->GetWebEngine()); + // Check if web view is found or not when plugin is not null. + DALI_TEST_CHECK(WebView::FindWebView(gRequestInterceptorInstance->GetWebEngine())); + std::string testUrl("http://test.html"); DALI_TEST_EQUALS(gRequestInterceptorInstance->GetUrl(), testUrl, TEST_LOCATION); std::string testMethod("GET"); @@ -1681,6 +1718,8 @@ int UtcDaliWebContextHttpRequestInterceptor(void) Dali::Property::Map resultHeaders = gRequestInterceptorInstance->GetHeaders(); DALI_TEST_EQUALS(resultHeaders.Count(), 2, TEST_LOCATION); + // Destroy web view. + view.Reset(); gRequestInterceptorInstance = nullptr; END_TEST; @@ -2328,3 +2367,50 @@ int UtcDaliWebViewGetPlainText(void) END_TEST; } + +int UtcDaliWebViewVisibilityChange(void) +{ + ToolkitTestApplication application; + + WebView view = WebView::New(); + Control dummy = Control::New(); + DALI_TEST_CHECK(view); + DALI_TEST_CHECK(dummy); + + view.LoadUrl(TEST_URL1); + + dummy.Add(view); + auto window = application.GetWindow(); + window.Add(dummy); + + application.SendNotification(); + application.Render(); + + try + { + // TODO : There is no way to check visiblity setting result from web engine. + // Just call API and exception check. + view.SetProperty(Actor::Property::VISIBLE, false); + view.SetProperty(Actor::Property::VISIBLE, true); + dummy.SetProperty(Actor::Property::VISIBLE, false); + dummy.SetProperty(Actor::Property::VISIBLE, true); + dummy.Unparent(); + window.Hide(); + window.Add(dummy); + window.Show(); + window.Hide(); + window.Show(); + dummy.SetProperty(Actor::Property::VISIBLE, false); + view.SetProperty(Actor::Property::VISIBLE, false); + dummy.SetProperty(Actor::Property::VISIBLE, true); + view.SetProperty(Actor::Property::VISIBLE, true); + tet_result(TET_PASS); + } + catch(...) + { + // Should not throw exception + tet_result(TET_FAIL); + } + + END_TEST; +} \ No newline at end of file