1 // Copyright 2014 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "utc_blink_ewk_base.h"
7 class utc_blink_ewk_view_session_data_get_func : public utc_blink_ewk_base
10 std::string firstPage;
11 const char *sessionData;
13 void PreSetUp() override {
14 firstPage = GetResourceUrl("common/sample.html");
18 void LoadFinished(Evas_Object*) override { EventLoopStop(Success); }
20 void PostTearDown() override {
22 free(const_cast<char *>(sessionData));
28 * @brief Tests if returns valid webview when called with correct Evas object.
30 TEST_F(utc_blink_ewk_view_session_data_get_func, POS_TEST)
32 ewk_view_url_set(GetEwkWebView(), firstPage.c_str());
36 ewk_view_session_data_get(GetEwkWebView(), &sessionData, &length);
38 ASSERT_TRUE(sessionData);
43 * @brief Tests if returns NULL when called with NULL webview object.
45 TEST_F(utc_blink_ewk_view_session_data_get_func, NEG_TEST_NULL_WEBVIEW)
47 ewk_view_url_set(GetEwkWebView(), firstPage.c_str());
52 ewk_view_session_data_get(NULL, &data, &length);
59 * @brief Tests if returns NULL when called with NULL data.
61 TEST_F(utc_blink_ewk_view_session_data_get_func, NEG_TEST_NULL_DATA)
63 ewk_view_url_set(GetEwkWebView(), firstPage.c_str());
68 ewk_view_session_data_get(GetEwkWebView(), NULL, &length);
72 * @brief Tests if returns NULL when called with NULL length.
74 TEST_F(utc_blink_ewk_view_session_data_get_func, NEG_TEST_NULL_LENGTH)
76 ewk_view_url_set(GetEwkWebView(), firstPage.c_str());
81 ewk_view_session_data_get(GetEwkWebView(), &data, NULL);