[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_settings_scripts_can_open_windows_get_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_scripts_can_open_windows_get : public utc_blink_ewk_base {
8 protected:
9   utc_blink_ewk_settings_scripts_can_open_windows_get()
10     : settings(NULL)
11   {
12   }
13
14   void PostSetUp() override {
15     settings = ewk_view_settings_get(GetEwkWebView());
16     ASSERT_TRUE(settings);
17     // make sure default value is proper
18     ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_get(settings));
19   }
20
21 protected:
22   Ewk_Settings* settings;
23 };
24
25 /**
26  * @brief Positive test case of ewk_settings_scripts_can_open_windows_get()
27  */
28 TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_get, SetFalse)
29 {
30   // toggle option
31   ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_FALSE));
32   // check if option was toggled
33   ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
34 }
35
36 /**
37  * @brief Test case of ewk_settings_scripts_can_open_windows_get() when view is NULL
38  */
39 TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_get, InvalidArg)
40 {
41   EXPECT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(NULL));
42 }