[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_view_url_get_func.cpp
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.
4
5 #include "utc_blink_ewk_base.h"
6
7 static const char* TEST_URL = "http://www.google.com/";
8
9 class utc_blink_ewk_view_url_get : public utc_blink_ewk_base {
10 };
11
12 /**
13 * @brief Checking whether url is properly set.
14  */
15 TEST_F(utc_blink_ewk_view_url_get, POS_TEST)
16 {
17   Eina_Bool result = ewk_view_url_set(GetEwkWebView(), TEST_URL);
18   if (!result) {
19     FAIL();
20   }
21
22   const char* currentUrl = ewk_view_url_get(GetEwkWebView());
23   EXPECT_STREQ(currentUrl, TEST_URL);
24 }
25
26 /**
27 * @brief Checking whether function works properly in case of NULL of a webview.
28  */
29 TEST_F(utc_blink_ewk_view_url_get, NEG_TEST)
30 {
31   const char* currentUrl = ewk_view_url_get(NULL);
32   EXPECT_EQ(currentUrl ? EINA_TRUE : EINA_FALSE, EINA_FALSE);
33 }
34