[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_settings_dom_paste_allowed_set_func.cpp
1 // Copyright 2016 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_dom_paste_allowed_set_func
8     : public utc_blink_ewk_base {
9  protected:
10   utc_blink_ewk_settings_dom_paste_allowed_set_func()
11       : settings_(nullptr) {
12   }
13
14   void PostSetUp() override {
15     settings_ = ewk_view_settings_get(GetEwkWebView());
16     ASSERT_TRUE(settings_ != nullptr);
17   }
18
19   Ewk_Settings* settings_;
20 };
21
22 /**
23  * @brief Tests whether the function works properly for case 2nd param is TRUE.
24  */
25 TEST_F(utc_blink_ewk_settings_dom_paste_allowed_set_func, POS_ENABLE_TRUE) {
26   EXPECT_TRUE(ewk_settings_dom_paste_allowed_set(settings_, EINA_TRUE));
27 }
28
29 /**
30  * @brief Tests whether the function works properly for case 2nd param is FALSE.
31  */
32 TEST_F(utc_blink_ewk_settings_dom_paste_allowed_set_func, POS_ENABLE_FALSE) {
33   EXPECT_TRUE(ewk_settings_dom_paste_allowed_set(settings_, EINA_FALSE));
34 }
35
36 /**
37  * @brief Tests whether the function works properly
38  *        for case Ewk_Settings object is NULL.
39  */
40 TEST_F(utc_blink_ewk_settings_dom_paste_allowed_set_func,
41        NEG_INVALID_SETTINGS_PARAM) {
42   EXPECT_FALSE(ewk_settings_dom_paste_allowed_set(nullptr, EINA_TRUE));
43 }