Merge branch 'dev/ewk_test_base' into dev/ewk_test
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_view_stop_func.cpp
1
2 /*
3  * chromium EFL
4  *
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * This library is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
13  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc., 51
19  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22
23 #include "utc_blink_ewk_base.h"
24
25 class utc_blink_ewk_view_stop : public utc_blink_ewk_base
26 {
27 protected:
28
29   static const char* const sample_html_file;
30 };
31
32 const char* const utc_blink_ewk_view_stop::sample_html_file = "/common/sample.html";
33
34 /**
35  * @brief Positive  test case of ewk_view_stop()
36  * ewk_view_stop should return TRUE  as we are stopping the load with a valid url
37  */
38 TEST_F(utc_blink_ewk_view_stop, POS_TEST)
39 {
40   if (!ewk_view_url_set(GetEwkWebView(), GetResourceUrl(sample_html_file).c_str()))
41     FAIL();
42
43   Eina_Bool result = ewk_view_stop(GetEwkWebView());
44   EXPECT_EQ(result, EINA_TRUE);
45 }
46
47 /**
48  * @brief Negative  test case of ewk_view_stop()
49  * ewk_view_stop should return FALSE as we are stopping the load with NULL
50  */
51 TEST_F(utc_blink_ewk_view_stop, NEG_TEST)
52 {
53   Eina_Bool result = ewk_view_stop(NULL);
54   EXPECT_EQ(result, EINA_FALSE);
55 }