[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_settings_dom_paste_allowed_get_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_get_func
8     : public utc_blink_ewk_base {
9  protected:
10   utc_blink_ewk_settings_dom_paste_allowed_get_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_get_func, POS_ENABLE_TRUE) {
26   ASSERT_TRUE(ewk_settings_dom_paste_allowed_set(settings_, EINA_TRUE));
27   EXPECT_TRUE(ewk_settings_dom_paste_allowed_get(settings_));
28 }
29
30 /**
31  * @brief Tests whether the function works properly for case 2nd param is FALSE.
32  */
33 TEST_F(utc_blink_ewk_settings_dom_paste_allowed_get_func, POS_ENABLE_FALSE) {
34   ASSERT_TRUE(ewk_settings_dom_paste_allowed_set(settings_, EINA_FALSE));
35   EXPECT_FALSE(ewk_settings_dom_paste_allowed_get(settings_));
36 }
37
38 /**
39  * @brief Tests whether the function works properly
40  *        for case Ewk_Settings object is NULL.
41  */
42 TEST_F(utc_blink_ewk_settings_dom_paste_allowed_get_func,
43        NEG_INVALID_SETTINGS_PARAM) {
44   EXPECT_FALSE(ewk_settings_dom_paste_allowed_get(nullptr));
45 }