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