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 #define URL ("http://google.com")
9 class utc_blink_cb_load_finished : public utc_blink_ewk_base
12 /* Callback for "load,finished" */
13 void LoadFinished(Evas_Object* webview) override {
14 EventLoopStop(utc_blink_ewk_base::Success);
19 * @brief Tests "load,finished" callback with ewl_view_html_string_load
21 TEST_F(utc_blink_cb_load_finished, html_string_load)
23 char htmlBuffer[] = "<html>"
24 "<head><title>TC ewk_view_html_load_string</title></head>"
25 "<body><p>TC ewk_view_html_load_string</p></body>"
28 Eina_Bool result = ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL);
33 utc_check_eq(EventLoopStart(), utc_blink_ewk_base::Success);
37 * @brief Tests "load,finished" callback with ewk_view_url_set http protocol
39 TEST_F(utc_blink_cb_load_finished, url_set_http)
41 utc_message("Loading url: %s", URL);
42 Eina_Bool result = ewk_view_url_set(GetEwkWebView(), URL);
47 utc_check_eq(EventLoopStart(), utc_blink_ewk_base::Success);
51 * @brief Tests "load,finished" callback with ewk_view_urls_set local file
53 TEST_F(utc_blink_cb_load_finished, url_set_file)
55 std::string resource_url = GetResourceUrl("common/sample.html");
56 utc_message("Loading file: %s", resource_url.c_str());
57 Eina_Bool result = ewk_view_url_set(GetEwkWebView(), resource_url.c_str());
62 utc_check_eq(EventLoopStart(), utc_blink_ewk_base::Success);