[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_settings_loads_images_automatically_set_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 class utc_blink_ewk_settings_loads_images_automatically_set : public utc_blink_ewk_base {
8 };
9
10
11 /**
12  * @brief Tests if returns TRUE when initiated with a correct webview and set to TRUE.
13  */
14 TEST_F(utc_blink_ewk_settings_loads_images_automatically_set, POS_TEST1)
15 {
16   Ewk_Settings* settings = ewk_view_settings_get(GetEwkWebView());
17   if (!settings) {
18     FAIL();
19   }
20
21   Eina_Bool result = ewk_settings_loads_images_automatically_set(settings, EINA_TRUE);
22   if (!result) {
23     FAIL();
24   }
25   result = ewk_settings_loads_images_automatically_get(settings);
26   EXPECT_EQ(result, EINA_TRUE);
27 }
28
29 /**
30  * @brief Tests if returns FALSE when initiated with a correct webview and set to FALSE.
31  */
32 TEST_F(utc_blink_ewk_settings_loads_images_automatically_set, POS_TEST2)
33 {
34   Ewk_Settings* settings = ewk_view_settings_get(GetEwkWebView());
35   if (!settings) {
36     FAIL();
37   }
38
39   Eina_Bool result = ewk_settings_loads_images_automatically_set(settings, EINA_FALSE);
40   if (!result) {
41     FAIL();
42   }
43   result = ewk_settings_loads_images_automatically_get(settings);
44   EXPECT_EQ(result, EINA_FALSE);
45 }
46
47 /**
48  * @brief Tests if returns FALSE when initiated with NULL webview.
49  */
50 TEST_F(utc_blink_ewk_settings_loads_images_automatically_set, NEG_TEST)
51 {
52   Eina_Bool result = ewk_settings_loads_images_automatically_set(NULL, EINA_TRUE);
53   EXPECT_EQ(result, EINA_FALSE);
54 }