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_error_type_get : public utc_blink_ewk_base {
9 utc_blink_ewk_error_type_get()
10 : error_type(EWK_ERROR_TYPE_NONE)
14 /* Callback for load error */
15 bool LoadError(Evas_Object* webview, Ewk_Error* error) override {
16 utc_message("[load_error] :: ");
17 error_type = ewk_error_type_get(error);
18 EventLoopStop(utc_blink_ewk_base::Success);
23 Ewk_Error_Type error_type;
24 static const char* const test_url;
27 const char* const utc_blink_ewk_error_type_get::test_url = "http://page_that_does_not_exist";
30 * @brief Positive test case of ewk_error_type_get(). Page is loaded and stopped in between to generate loadError
32 TEST_F(utc_blink_ewk_error_type_get, POS_TEST)
34 ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), test_url));
35 ASSERT_EQ(utc_blink_ewk_base::Success, EventLoopStart());
36 ASSERT_EQ(EWK_ERROR_TYPE_NETWORK, error_type); // right now this is the only error type supported
40 * @brief Checking whether function works properly in case of NULL argument.
42 TEST_F(utc_blink_ewk_error_type_get, NEG_TEST)
44 ASSERT_EQ(EWK_ERROR_TYPE_NONE, ewk_error_type_get(NULL));