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"
8 class utc_blink_ewk_view_forward : public utc_blink_ewk_base {
10 void LoadFinished(Evas_Object* webview) override {
11 EventLoopStop(utc_blink_ewk_base::Success);
15 static const char * const SAMPLE_HTML_FILE;
16 static const char * const SAMPLE_1_HTML_FILE;
19 const char * const utc_blink_ewk_view_forward::SAMPLE_HTML_FILE = "/common/sample.html";
20 const char * const utc_blink_ewk_view_forward::SAMPLE_1_HTML_FILE = "/common/sample_1.html";
23 * @brief Check whether it is possible to go forward when two pages are loaded and back is done
25 TEST_F(utc_blink_ewk_view_forward, POS_TEST)
27 if (!ewk_view_url_set(GetEwkWebView(), GetResourceUrl(SAMPLE_HTML_FILE).c_str())) {
30 if (utc_blink_ewk_base::Success != EventLoopStart()) {
34 if (!ewk_view_url_set(GetEwkWebView(), GetResourceUrl(SAMPLE_1_HTML_FILE).c_str())) {
37 if (utc_blink_ewk_base::Success != EventLoopStart()) {
41 Eina_Bool backResult = ewk_view_back(GetEwkWebView());
42 if (utc_blink_ewk_base::Success != EventLoopStart()) {
46 const char* currentUrl = ewk_view_url_get(GetEwkWebView());
47 EXPECT_STREQ(currentUrl, GetResourceUrl(SAMPLE_HTML_FILE).c_str());
49 Eina_Bool forwardResult = ewk_view_forward(GetEwkWebView());
50 if (utc_blink_ewk_base::Success != EventLoopStart()) {
54 EXPECT_EQ(forwardResult, EINA_TRUE);
58 * @brief Checking whether function works properly in case of NULL of a webview.
60 TEST_F(utc_blink_ewk_view_forward, NEG_TEST)
62 Eina_Bool result = ewk_view_forward(NULL);
63 EXPECT_EQ(result, EINA_FALSE);