[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_string_value.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 <cstring>
6
7 #include "ewk_value_product.h"
8 #include "utc_blink_ewk_base.h"
9 #include "utc_blink_ewk_value_compare.h"
10
11 class utc_blink_ewk_string_value : public utc_blink_ewk_base {};
12
13 TEST_F(utc_blink_ewk_string_value, POS_TEST) {
14   // check type
15   Ewk_Value v = ewk_value_string_new("");
16   EXPECT_EQ(ewk_value_type_get(v), ewk_value_string_type_get());
17   ewk_value_unref(v);
18
19   // check value range
20   for (size_t i = 0; i < ArraySize(test_strings); ++i) {
21     v = ewk_value_string_new(test_strings[i]);
22     Eina_Stringshare* str = ewk_value_string_value_get(v);
23     ASSERT_TRUE(str != NULL);
24     EXPECT_STREQ((const char*)str, test_strings[i]);
25     eina_stringshare_del(str);
26     ewk_value_unref(v);
27   }
28 }